0

I am trying to authenticate a user and getting the user to authorize my application. But, whenever the user authenticates with the system, the redirect url never return back to my application.

In the console output i get the following information message:

INFO: Unable to retrieve OAuth2.0 handler for redirect request tohttps://localhost:8443/sbt.sample.web/service/oauth20_cb. Please check you are accessing the application using the same hostname used in the OAuth 2.0 redirect URI.

Please find below the code:

// Check if user is authenticated, if not redirect to SmartCloud for authentication.

    ep= EndpointFactory.getEndpoint("connectionsOA2");

    if(!ep.isAuthenticationValid()) 
    {        
         // Check, Do we have a valid token for this user
         ep.authenticate(false);// Authenticate
         return; // Exit, JSP would be invoked from Callback handler
    }  

I am not able to figure out what is the problem. Any help is highly appreciated.

1 Answers1

0

generally the warning comes from the following:

User logs in to http://localhost:8080/sbt.sample.web/ or http://qs.renovations.com:8443/sbt.sample.web or http://localhost:8080/my.project

The app redirects to Connections

User Logs in to Connections

Connections redirects to https://localhost:8443/sbt.sample.web/service/oauth20_cb

1 the components in the URL are not the same as the initiator of the OAuth session

2 uses a different port or different hostname

The request was initiated on one URL and the response was redirected to another.

Community
  • 1
  • 1
Paul Bastide
  • 1,505
  • 4
  • 17
  • 22