1
votes

I did this for change the username to email:

  1. Add New User in carbon where username is email.
  2. In "Select Roles of the User", select all.
  3. After that in [API-MANAGER]/repository/conf in the file deployment.toml add this line

deployment.toml

[tenant_mgt]
enable_email_domain= true

And edit:

[super_admin]
username = "EmailAddress"
password = "somepassword"
create_admin_account = true

Where email address is the same email and password to add in carbon.

  1. Restart the server.

Check in https://localhost:9443/carbon, https://localhost:9443/publisher and https://localhost:9443/devportal. And NO problem to sign in, but in terminal I have this:

ERROR - DataEndpointConnectionWorker Error while trying to connect to the endpoint. Cannot borrow client for ssl://172.17.0.1:9711. org.wso2.carbon.databridge.agent.exception.DataEndpointLoginException: Cannot borrow client for ssl://172.17.0.1:9711. at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:145) ~[org.wso2.carbon.databridge.agent_5.2.12.jar:?] at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.run(DataEndpointConnectionWorker.java:59) [org.wso2.carbon.databridge.agent_5.2.12.jar:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:834) [?:?] Caused by: org.wso2.carbon.databridge.agent.exception.DataEndpointLoginException: Error while trying to login to data receiver :/172.17.0.1:9711 at org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint.login(BinaryDataEndpoint.java:50) ~[org.wso2.carbon.databridge.agent_5.2.12.jar:?] at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:139) ~[org.wso2.carbon.databridge.agent_5.2.12.jar:?] ... 6 more Caused by: org.wso2.carbon.databridge.commons.exception.AuthenticationException: java.lang.NullPointerException at jdk.internal.reflect.GeneratedConstructorAccessor267.newInstance(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?] at org.wso2.carbon.databridge.agent.endpoint.binary.BinaryEventSender.processResponse(BinaryEventSender.java:163) ~[org.wso2.carbon.databridge.agent_5.2.12.jar:?] at org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint.login(BinaryDataEndpoint.java:44) ~[org.wso2.carbon.databridge.agent_5.2.12.jar:?] at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:139) ~[org.wso2.carbon.databridge.agent_5.2.12.jar:?] ... 6 more

Is a problem? In case is a problem affect in production ambient? How fix?

Edit: After to read the problem is:

In username the character @ is not possible to use

So, change my cuestion: If possible to create a username similar to [email protected] or how to fix?

1

1 Answers

0
votes

Use the fully qualified user name for the [super_admin] configuration as follows.

[super_admin]
username = "[email protected]@carbon.super"

Also, you need to do the following configurations as well to the deployment.toml file.

[user_store.properties]
UsernameWithEmailJavaScriptRegEx = "^[\\S]{3,30}$"
UsernameJavaScriptRegEx = "^[a-zA-Z0–9._-]+@[a-zA-Z0–9.-]+\\.[a-zA-Z]{2,4}$"
UsernameJavaRegEx = "^[a-zA-Z0–9._-]+@[a-zA-Z0–9.-]+\\.[a-zA-Z]{2,4}$"

[apim.throttling.jms]
#start_delay = "5m"
username = "admin!wso2.com!carbon.super"

In [APIM_HOME]/repository/conf/claim-config.xml file, change the attribute of the username claim as below.

    <Claim>
        <ClaimURI>http://wso2.org/claims/username</ClaimURI>
        <DisplayName>Username</DisplayName>
        <AttributeID>mail</AttributeID>
        <Description>Username</Description>
    </Claim>

Thanks

Menaka