0 Replies Latest reply on May 11, 2018 5:52 AM by Candy110

    idcs-sdk-sample-apps cannot work

    Candy110

      I'm trying this example for IDCS SDK with Web application.

      http://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/idcs/idcs_java_sdk_obe/idcs-java-sdk.html

       

      Does this example and SDK work fine you expected?  It seems that user information cannot be got from IDCS in the part of CallbackServlet.

       

      //Getting the Access Token Value.

      String access_token = ar.getAccessToken();

       

      //The application then creates a User Session.

      IDCSUserManager um = new IDCSUserManagerImpl(config);

      IDCSUser user = um.getAuthenticatedUser(access_token);   <--- user is returned as null

       

      Access token would be valid because I can get user information by using it with REST API. so I'm not sure what could cause this problem.

       

      警告: Exception getting jwks for tenant: idcs-baa6d43cf10d4f978b9fa2a7b3a11dff , reason: java.io.IOException: OAuth Token Endpoint returned error: unauthorized_client - Client authorization failed [金 5 11 14:14:48 JST 2018]

      情報: Failed to fetch user. [金 5 11 14:14:48 JST 2018]

      java.lang.RuntimeException: Failed to Validate Token

          at oracle.security.jps.idcsbinding.shared.AuthenticationManagerImpl.validateToken(AuthenticationManagerImpl.java:67)

          at oracle.security.jps.idcsbinding.shared.AuthenticationManagerImpl.validateAccessToken(AuthenticationManagerImpl.java:89)

          at oracle.security.jps.idcsbinding.shared.AuthenticationManagerImpl.validateAccessToken(AuthenticationManagerImpl.java:78)

          at oracle.security.jps.idcsbinding.shared.IDCSUserManagerImpl.getUser(IDCSUserManagerImpl.java:141)

          at oracle.security.jps.idcsbinding.shared.IDCSUserManagerImpl.getAuthenticatedUser(IDCSUserManagerImpl.java:43)

          at servlet.CallbackServlet.processRequest(CallbackServlet.java:62)

          at servlet.CallbackServlet.doGet(CallbackServlet.java:86)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)

          at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)

          at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498)

          at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)

          at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796)

          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1366)

          at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

          at java.lang.Thread.run(Thread.java:748)

      Caused by: java.lang.RuntimeException: java.io.IOException: OAuth Token Endpoint returned error: unauthorized_client - Client authorization failed

          at oracle.security.jps.idcsbinding.shared.IDCSJWKKeyManagerImpl.download(IDCSJWKKeyManagerImpl.java:156)

          at oracle.security.jps.idcsbinding.shared.IDCSJWKKeyManagerImpl.load(IDCSJWKKeyManagerImpl.java:192)

          at oracle.security.jps.idcsbinding.shared.IDCSProviderManagerImpl.loadKeyManager(IDCSProviderManagerImpl.java:221)

          at oracle.security.jps.idcsbinding.shared.IDCSProviderManagerImpl.getKeyManager(IDCSProviderManagerImpl.java:117)

          at oracle.security.jps.idcsbinding.shared.IDCSJWTTokenAssertImpl.validate(IDCSJWTTokenAssertImpl.java:97)

          at oracle.security.jps.idcsbinding.shared.IDCSTokenVerifier.verifyJwtToken(IDCSTokenVerifier.java:34)

          at oracle.security.jps.idcsbinding.shared.AuthenticationManagerImpl.validateToken(AuthenticationManagerImpl.java:45)

          ... 30 more

      Caused by: java.io.IOException: OAuth Token Endpoint returned error: unauthorized_client - Client authorization failed

          at oracle.security.jps.idcsbinding.shared.OAuthAccessTokenManagerImpl.obtainAccessToken(OAuthAccessTokenManagerImpl.java:293)

          at oracle.security.jps.idcsbinding.shared.OAuthAccessTokenManagerImpl.obtainCachedToken(OAuthAccessTokenManagerImpl.java:234)

          at oracle.security.jps.idcsbinding.shared.OAuthAccessTokenManagerImpl.getToken(OAuthAccessTokenManagerImpl.java:178)

          at oracle.security.jps.idcsbinding.shared.OAuthAccessTokenManagerImpl.getAccessTokenHttpHeader(OAuthAccessTokenManagerImpl.java:111)

          at oracle.security.jps.idcsbinding.shared.IDCSHTTPRequestHelper.getSecuredResponse(IDCSHTTPRequestHelper.java:104)

          at oracle.security.jps.idcsbinding.shared.IDCSJWKKeyManagerImpl.download(IDCSJWKKeyManagerImpl.java:147)

          ... 36 more

      重大: サーブレット [CallbackServlet] のServlet.service()が例外を投げました [金 5 11 14:14:48 JST 2018]