On Mon, Sep 1, 2014 at 1:22 PM, Chamila Adhikarinayake <chami...@wso2.com> wrote:
> Modifying <SignUpDomain>T2.COM</SignUpDomain> to > <SignUpDomain>PRIMARY</SignUpDomain> fixed the error (without modifying the > code). Thank you for your explanation regarding this. > Yes, in this case domain means the userstore name, the terminology comes from IS. Once you get this working with Primary user store, add a secondary userstore as well, and test if you can add users to it as well. > > > Chamila. > > > On Mon, Sep 1, 2014 at 12:04 PM, Chamila Adhikarinayake <chami...@wso2.com > > wrote: > >> Hi Shariq, >> >> I debuged the addUser method in >> org.wso2.carbon.identity.user.registration.UserRegistrationService >> class and found the code snippet that causes the error. >> >> if (tenantConfig != null && tenantConfig.getSignUpDomain() != "") { >> int index = userName.indexOf(UserCoreConstants. >> DOMAIN_SEPARATOR); >> if (index > 0) { >> userName = tenantConfig.getSignUpDomain().toUpperCase >> () + UserCoreConstants.DOMAIN_SEPARATOR + userName.substring(index + 1); >> } else { >> userName = tenantConfig.getSignUpDomain().toUpperCase >> () + UserCoreConstants.DOMAIN_SEPARATOR + userName; >> } >> } >> >> From this part the username is changed from 'chamila' to 'T2.COM/chamila' >> and this causes the 'Invalid Domain Name' error when adding a user. I was >> able to create users for tenants (using roles in the registry entry) by >> removing this part. Is there any reason for having this part? (any other >> places that might fail) or is it ok to remove this? >> >> Thanks, >> Chamila. >> >> >> On Fri, Aug 29, 2014 at 2:48 PM, Chamila Adhikarinayake < >> chami...@wso2.com> wrote: >> >>> Hi Shariq, >>> I modified according to the way you mentioned and was able to create >>> users for tenants with default configuration (Internal/identity). But when >>> I created the registry entry for tenants as the way you described in the >>> architecture thread, I get the following error. My registry entry in >>> '/_system/governance/repository/identity/sign-up-config' for domain T2.com >>> is >>> >>> <SelfSignUp> >>> <SignUpDomain>T2.COM</SignUpDomain> >>> <SignUpRole> >>> <RoleName>test</RoleName> >>> <IsExternalRole>false</IsExternalRole> >>> </SignUpRole> >>> </SelfSignUp> >>> >>> Username passed for this is cham...@t2.com. I created a separate >>> internal role 'test' with some permission. I did not do any other >>> configuration in the API manager. Can you point out my mistake. I can >>> create users with roles by adding following to the identity.xml >>> >>> <SelfSignUp> >>> <SignUpRole> >>> <Name>subscriber</Name> >>> <External>false</External> >>> </SignUpRole> >>> </SelfSignUp> >>> >>> following is the error log. >>> >>> org.wso2.carbon.identity.base.IdentityException: Error occurred while >>> adding user : T2.COM/chamila >>> at >>> org.wso2.carbon.identity.user.registration.UserRegistrationService.addUser(UserRegistrationService.java:268) >>> at >>> org.wso2.carbon.identity.user.registration.UserRegistrationService.addUser(UserRegistrationService.java:162) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at sun.reflect.NativeMethodAccessorImpl.invoke( >>> NativeMethodAccessorImpl.java:39) >>> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >>> DelegatingMethodAccessorImpl.java:25) >>> at java.lang.reflect.Method.invoke(Method.java:597) >>> at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass( >>> RPCUtil.java:212) >>> at org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver. >>> invokeBusinessLogic(RPCInOnlyMessageReceiver.java:66) >>> at org.apache.axis2.receivers.AbstractMessageReceiver.receive( >>> AbstractMessageReceiver.java:110) >>> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) >>> at >>> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172) >>> at org.apache.axis2.transport.http.AxisServlet.doPost( >>> AxisServlet.java:146) >>> at org.wso2.carbon.core.transports.CarbonServlet.doPost( >>> CarbonServlet.java:231) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) >>> at >>> org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61) >>> at >>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128) >>> at >>> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68) >>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) >>> at >>> org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68) >>> at >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) >>> at >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) >>> at >>> org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61) >>> at >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) >>> at >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) >>> at >>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) >>> at >>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) >>> at >>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) >>> at >>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) >>> at >>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) >>> at >>> org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178) >>> at >>> org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47) >>> at >>> org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56) >>> at >>> org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47) >>> at >>> org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141) >>> at >>> org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156) >>> at >>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) >>> at >>> org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52) >>> at >>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) >>> at >>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) >>> at >>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) >>> at >>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) >>> at >>> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) >>> at >>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) >>> at java.lang.Thread.run(Thread.java:662) >>> Caused by: org.wso2.carbon.user.core.UserStoreException: Invalid Domain >>> Name >>> at >>> org.wso2.carbon.user.core.common.AbstractUserStoreManager.getUserStore(AbstractUserStoreManager.java:2301) >>> at >>> org.wso2.carbon.user.core.common.AbstractUserStoreManager.addUser(AbstractUserStoreManager.java:1035) >>> at >>> org.wso2.carbon.user.core.common.AbstractUserStoreManager.addUser(AbstractUserStoreManager.java:1179) >>> at >>> org.wso2.carbon.identity.user.registration.UserRegistrationService.addUser(UserRegistrationService.java:231) >>> ... 45 more >>> >>> >>> Thanks, >>> Chamila. >>> >>> >>> On Fri, Aug 22, 2014 at 12:30 PM, Shariq Muhammed <sha...@wso2.com> >>> wrote: >>> >>>> Hi Chamil, >>>> >>>> The service name is UserRegistrationService and it is not an >>>> AdminService. Please refer to the existing sign-up code in API-M, it uses >>>> this service to sign-up users. Like I said y'day, you need to prepend >>>> "@tenantDomain" to the username, and that particular user will be added to >>>> the specified tenant domain. >>>> >>>> >>>> >>>> >>>> On Fri, Aug 22, 2014 at 10:40 AM, Chamila Adhikarinayake < >>>> chami...@wso2.com> wrote: >>>> >>>>> Hi All, >>>>> I started working on self sign up feature for tenants API store. Some >>>>> previous discussion on this can be found in the thread "[Architecture] >>>>> Provide support for self signup for tenants' APIStores". >>>>> >>>>> I went through the code for current self signup and it uses a >>>>> 'UserRegistrationAdminService' to add a user. But this adds a user to >>>>> super >>>>> tenant only. Is there any other service I can use to add a user to a >>>>> different tenant?. Also there is a mentioning about a >>>>> 'UserSelfRegistrationService' in the above mentioned thread but I could >>>>> not >>>>> find it in the admin service list. >>>>> >>>>> Thanks in advance >>>>> Chamila. >>>>> >>>>> -- >>>>> Regards, >>>>> Chamila Adhikarinayake >>>>> Software Engineer >>>>> WSO2, Inc. >>>>> Mobile - +94712346437 >>>>> Email - chami...@wso2.com >>>>> >>>> >>>> >>>> >>>> -- >>>> Thanks, >>>> Shariq >>>> Senior Software Engineer >>>> >>> >>> >>> >>> -- >>> Regards, >>> Chamila Adhikarinayake >>> Software Engineer >>> WSO2, Inc. >>> Mobile - +94712346437 >>> Email - chami...@wso2.com >>> >> >> >> >> -- >> Regards, >> Chamila Adhikarinayake >> Software Engineer >> WSO2, Inc. >> Mobile - +94712346437 >> Email - chami...@wso2.com >> > > > > -- > Regards, > Chamila Adhikarinayake > Software Engineer > WSO2, Inc. > Mobile - +94712346437 > Email - chami...@wso2.com > -- Thanks, Shariq Senior Software Engineer
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev