wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
845 stars 785 forks source link

publisher devportal apps does not function properly when username is an email #6470

Closed isharac closed 4 years ago

isharac commented 5 years ago

Steps:

Create a user(subscriber) with an email as the username in the super tenant. Try to login to devportal with the email username. (subscriber@gmail.com@carbon.super)

note: EnableEmailUserNam is NOT enabled in this case.

Below error is observed in the carbon console.

[2019-10-15 16:24:58,543] ERROR - UserAwareAPIConsumer Error while obtaining registry objects org.wso2.carbon.registry.core.exceptions.RegistryException: Failed to obtain the user realm for tenant: -1. at org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:304) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.session.UserRegistry.access$100(UserRegistry.java:61) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.session.UserRegistry$2.run(UserRegistry.java:249) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_191] at org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:246) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:225) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getUserRegistry(EmbeddedRegistryService.java:427) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getRegistry(EmbeddedRegistryService.java:447) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getGovernanceUserRegistry(EmbeddedRegistryService.java:526) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.apimgt.impl.AbstractAPIManager.(AbstractAPIManager.java:179) [org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.APIConsumerImpl.(APIConsumerImpl.java:198) [org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.UserAwareAPIConsumer.(UserAwareAPIConsumer.java:48) [org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.APIManagerFactory.newConsumer_aroundBody4(APIManagerFactory.java:56) [org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.APIManagerFactory.newConsumer(APIManagerFactory.java:52) [org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.APIManagerFactory.getAPIConsumer_aroundBody10(APIManagerFactory.java:89) [org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.APIManagerFactory.getAPIConsumer(APIManagerFactory.java:80) [org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil.getLoggedInUserConsumer(RestApiUtil.java:246) [org.wso2.carbon.apimgt.rest.api.util_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.rest.api.util.interceptors.SubscriberRegistrationInterceptor.handleMessage(SubscriberRegistrationInterceptor.java:74) [org.wso2.carbon.apimgt.rest.api.util_6.5.260.SNAPSHOT.jar:?] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.2.8.jar:3.2.8] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.2.8.jar:3.2.8] at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:225) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [tomcat-servlet-api_9.0.22.wso2v1.jar:?] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat_9.0.22.wso2v1.jar:?] at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:80) [org.wso2.carbon.identity.context.rewrite.valve_1.3.6.jar:?] at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:100) [org.wso2.carbon.identity.authz.valve_1.3.6.jar:?] at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:74) [org.wso2.carbon.identity.auth.valve_1.3.6.jar:?] at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:146) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) [tomcat_9.0.22.wso2v1.jar:?] at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve.invoke(RequestCorrelationIdValve.java:116) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat_9.0.22.wso2v1.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_191] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_191] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat_9.0.22.wso2v1.jar:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191] [2019-10-15 16:24:58,738] ERROR - SubscriberRegistrationInterceptor Unable to add the subscriber subscriber@gmail.com org.wso2.carbon.apimgt.api.APIManagementException: Error while obtaining registry objects at org.wso2.carbon.apimgt.impl.AbstractAPIManager.(AbstractAPIManager.java:204) ~[org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.APIConsumerImpl.(APIConsumerImpl.java:198) ~[org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.UserAwareAPIConsumer.(UserAwareAPIConsumer.java:48) ~[org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.APIManagerFactory.newConsumer_aroundBody4(APIManagerFactory.java:56) ~[org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.APIManagerFactory.newConsumer(APIManagerFactory.java:52) ~[org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.APIManagerFactory.getAPIConsumer_aroundBody10(APIManagerFactory.java:89) ~[org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.impl.APIManagerFactory.getAPIConsumer(APIManagerFactory.java:80) ~[org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil.getLoggedInUserConsumer(RestApiUtil.java:246) [org.wso2.carbon.apimgt.rest.api.util_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.rest.api.util.interceptors.SubscriberRegistrationInterceptor.handleMessage(SubscriberRegistrationInterceptor.java:74) [org.wso2.carbon.apimgt.rest.api.util_6.5.260.SNAPSHOT.jar:?] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.2.8.jar:3.2.8] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.2.8.jar:3.2.8] at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:225) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [tomcat-servlet-api_9.0.22.wso2v1.jar:?] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat_9.0.22.wso2v1.jar:?] at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:80) [org.wso2.carbon.identity.context.rewrite.valve_1.3.6.jar:?] at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:100) [org.wso2.carbon.identity.authz.valve_1.3.6.jar:?] at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:74) [org.wso2.carbon.identity.auth.valve_1.3.6.jar:?] at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:146) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) [tomcat_9.0.22.wso2v1.jar:?] at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve.invoke(RequestCorrelationIdValve.java:116) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat_9.0.22.wso2v1.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_191] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_191] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat_9.0.22.wso2v1.jar:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191] Caused by: org.wso2.carbon.registry.core.exceptions.RegistryException: Failed to obtain the user realm for tenant: -1. at org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:304) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.session.UserRegistry.access$100(UserRegistry.java:61) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.session.UserRegistry$2.run(UserRegistry.java:249) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_191] at org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:246) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.session.UserRegistry.(UserRegistry.java:225) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getUserRegistry(EmbeddedRegistryService.java:427) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getRegistry(EmbeddedRegistryService.java:447) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getGovernanceUserRegistry(EmbeddedRegistryService.java:526) ~[org.wso2.carbon.registry.core_4.5.1.jar:?] at org.wso2.carbon.apimgt.impl.AbstractAPIManager.(AbstractAPIManager.java:179) ~[org.wso2.carbon.apimgt.impl_6.5.260.SNAPSHOT.jar:?] ... 50 more

isharac commented 5 years ago

once the above error is fixed encountered below error. [2019-10-16 10:27:24,382] ERROR - GlobalThrowableMapper An unknown exception has been captured by the global exception mapper. java.lang.NullPointerException: null at org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil.rootCauseMessageMatches(RestApiUtil.java:663) ~[org.wso2.carbon.apimgt.rest.api.util_6.5.260.SNAPSHOT.jar:?] at org.wso2.carbon.apimgt.rest.api.store.v1.impl.ApisApiServiceImpl.apisGet(ApisApiServiceImpl.java:140) ~[classes/:?] at org.wso2.carbon.apimgt.rest.api.store.v1.ApisApi.apisGet(ApisApi.java:307) ~[classes/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_191] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_191] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_191] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_191] at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) ~[cxf-core-3.2.8.jar:3.2.8] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[cxf-core-3.2.8.jar:3.2.8] at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:193) [cxf-rt-frontend-jaxrs-3.2.8.jar:3.2.8] at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103) [cxf-rt-frontend-jaxrs-3.2.8.jar:3.2.8] at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [cxf-core-3.2.8.jar:3.2.8] at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) [cxf-core-3.2.8.jar:3.2.8] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.2.8.jar:3.2.8] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.2.8.jar:3.2.8] at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:216) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:225) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [tomcat-servlet-api_9.0.22.wso2v1.jar:?] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276) [cxf-rt-transports-http-3.2.8.jar:3.2.8] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat_9.0.22.wso2v1.jar:?] at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:80) [org.wso2.carbon.identity.context.rewrite.valve_1.3.6.jar:?] at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:100) [org.wso2.carbon.identity.authz.valve_1.3.6.jar:?] at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:74) [org.wso2.carbon.identity.auth.valve_1.3.6.jar:?] at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:146) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) [tomcat_9.0.22.wso2v1.jar:?] at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve.invoke(RequestCorrelationIdValve.java:116) [org.wso2.carbon.tomcat.ext_4.5.1.jar:?] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) [tomcat_9.0.22.wso2v1.jar:?] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat_9.0.22.wso2v1.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_191] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_191] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat_9.0.22.wso2v1.jar:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]

isharac commented 4 years ago

Fixed with https://github.com/wso2/carbon-apimgt/pull/7752

isharac commented 4 years ago

The problem in the new APIM 3.0.0 is,

we have improved our login mechanism to use OAuth/OpenID Connect as the web app logins. Hence, upon successful login, we consider the logged-in username as the username coming from the introspection response. This user is coming with the tenant domain appended. In super tenant admin username is coming as admin@carbon.super

But, in 2.x Jaggery apps, we had basic auth login and we directly get the user given name as the username. Therefore if super admin is logged as admin username is considered as admin If any user logged in as abc@gmail.com@carbon.super his username is considered as abc@gmail.com@carbon.super

So in DB tables such as AM_APPLICATIONS where username is stored for any reason can consist of usernames admin, abc@gmail.com@carbon.super

However, in 3.0.0 to achieve tenant aware username as 2.x what we have done is we have removed the tenant domain from the username. Therefore if super admin is logged as admin username is considered as admin If any user logged in as abc@gmail.com@carbon.super his username is considered as abc@gmail.com

Due to this, abc@gmail.com is unable to work in the publisher and devportal. The reason is according to the backend code, gmail.com is returned as the tenant domain.

Solution: To make the 2.x and 3.0.0 consistent and fix the issue with the email usernames in the super tenant, we need to remove @carbon.super from the username if and only if it is a super tenant user and username is not am email.

with this change, when there are username comparisons @UI level, we need to always compare username with tenant domain.

@malinthaadikari @bhathiya @kavishkafernando Any thoughts?