Invalid syntax in the authorization header.
Error :
Solution:
TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - Received a request : /oauth2/token {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - ----------logging request headers.---------- {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - authorization : Basic Og== {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - x-forwarded-server : ideabiz.lk {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - x-forwarded-for : 52.3.40.14 {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - content-type : application/x-www-form-urlencoded {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - accept : */* {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - x-forwarded-host : ideabiz.lk {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - transfer-encoding : chunked {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - host : identity.ideabiz.com:9443 {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - connection : Keep-Alive {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - user-agent : Synapse-PT-HttpComponents-NIO {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - ----------logging request parameters.---------- {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - grant_type - password {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - client_id - null {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - code - null {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,272] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - redirect_uri - null {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 00:24:15,273] WARN {org.apache.cxf.phase.PhaseInterceptorChain} - Application {http://authz.endpoint.oauth.identity.carbon.wso2.org/}OAuth2AuthzEndpoint has thrown exception, unwinding now {org.apache.cxf.phase.PhaseInterceptorChain} org.apache.cxf.interceptor.Fault at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:194) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:93) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:159) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206) at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 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.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ArrayIndexOutOfBoundsException TID: [0] [IS] [2017-08-19 00:24:15,273] WARN {org.apache.cxf.phase.PhaseInterceptorChain} - Exception in handleFault on interceptor org.apache.cxf.binding.xml.interceptor.XMLFaultOutInterceptor@7677e28f {org.apache.cxf.phase.PhaseInterceptorChain} org.apache.cxf.interceptor.Fault at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:194) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:93) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:159) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206) at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 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.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ArrayIndexOutOfBoundsException TID: [0] [IS] [2017-08-19 00:24:15,274] ERROR {org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver} - Error occurred during error handling, give up! {org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver} org.apache.cxf.interceptor.Fault at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:194) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:93) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:159) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206) at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 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.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ArrayIndexOutOfBoundsException TID: [0] [IS] [2017-08-19 00:24:15,274] ERROR {org.apache.catalina.core.StandardWrapperValve} - Servlet.service() for servlet [OAuth2Endpoints] in context with path [/oauth2] threw exception {org.apache.catalina.core.StandardWrapperValve} java.lang.RuntimeException: org.apache.cxf.interceptor.Fault at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:331) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:159) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206) at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 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.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.cxf.interceptor.Fault at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:194) at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:100) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:57) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:93) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271) ... 33 more Caused by: java.lang.ArrayIndexOutOfBoundsException
issue is due to invalid syntax in the authorization header. For example, following is a logged header from a failed request.
TID: [0] [IS] [2017-08-19 07:16:02,210] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - ----------logging request headers.---------- {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 07:16:02,210] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - authorization : Basic Og== {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint}
As you can see in the log the authorization header has only "authorization : Basic Og==" where "Og==" is base64 decoded into ":" (you can try with https://www.base64decode.org/)
A correct request should have the syntax "authorization : Basic <Base64encode(client_id:client_secret)>". That syntax is followed in success requests.
TID: [0] [IS] [2017-08-19 07:16:02,100] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - ----------logging request headers.---------- {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} TID: [0] [IS] [2017-08-19 07:16:02,100] DEBUG {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - authorization : Basic bnlnZk5DeXlBSV85SHpyYTRIZW11ZHk3R2FnYTpWRWZnbzR4UVQ0ZmRrRF9Gb2x1VnlZQlBOeXNh {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint}Failed to start new registry transaction
Error: TID: [0] [IS] [2017-07-30 00:00:00,728] ERROR {org.wso2.carbon.registry.core.dataaccess.TransactionManager} - Failed to start new registry transaction. {org.wso2.carbon.registry.core.dataaccess.TransactionManager} java.sql.SQLException: Connection has already been closed. at org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:117) at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109) Solution: Add following database configuration property (<testWhileIdle>true</testWhileIdle>) to the master-datasources.xml in both IS and APIM nodes<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration"> ... <datasource> <name>WSO2_USERSTORE_DB</name> ... <definition type="RDBMS"> <configuration> ... <testWhileIdle>true</testWhileIdle> </configuration> </definition> </datasource> <datasource> <name>WSO2_REGISTRY_DB</name> ... <definition type="RDBMS"> <configuration> ... <testWhileIdle>true</testWhileIdle> </configuration> </definition> </datasource> ... </datasources> </datasources-configuration>Please restart both IS and APIM nodes after this configuration change.