okta / okta-oidc-js

okta-oidc-js
https://github.com/okta/okta-oidc-js
Other
395 stars 232 forks source link

/implicit/callback route not working for any version of @okta/okta-angular #944

Open yashwanth-yenugu opened 3 years ago

yashwanth-yenugu commented 3 years ago

I'm submitting this issue for the package(s):

I'm submitting a:

Current behavior

We are using @okta/okta-angular for our login page and to login the user which goes pretty smoothly but once the callback route gets called we get a blank page it does not redirect back to the app. With version 1.0.7 it is working fine locally.I am able to redirect and continue with my application . We are using Authorization Code flow with PKCE. I do see all the details in url and also in the cookies...

/callback#id_token=eyJraWQiOiI2SXIxdXNldlhFVTI2dVNRNTZWa1QzeGFYcjFTSGdzNkZRcmprQ1ZpWVFRIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwMHVyM3N6dnRLWE5xREFnSzR4NiIsImVtYWlsIjoidmFzYXZpLmF5eWFsYXNvbWF5YWp1bGFAYWJqYXlvbi5jb20iLCJ2ZXIiOjEsImlzcyI6Imh0dHBzOi8vZGV2LTUzMzIzNi5va3RhLmNvbS9vYXV0aDIvZGVmYXVsdCIsImF1ZCI6IjBvYTE0bGw1ZzB4YnFvUUw5NHg3IiwiaWF0IjoxNjA1NTEyOTYxLCJleHAiOjE2MDU1MTY1NjEsImp0aSI6IklELjQ0WlF3TnRCYW9EUWhWbW1ZaGNtLThYdVg2SE5uMV9iSVBtaTI1SS1PRVUiLCJhbXIiOlsicHdkIl0sImlkcCI6IjAwb3IzcW5sd1UxNEVic1QzNHg2Iiwibm9uY2UiOiJIT3VCTHc4c1RTNk9ZQUJVdGxiMVV6cm9XaWhuT1lRV0hLclBnR3o1NzMydkRhWFBUZmJzVmZnem5UdDhPcmVnIiwiYXV0aF90aW1lIjoxNjA1NTEyOTYwLCJhdF9oYXNoIjoiZ29VQlhLblVpRTJEektBWkNxSHNqQSJ9.H08CQLOPwNjAMb7vC5dnYQ054Md9NMI0FQ7FQDoG2FeEXstFdZO-jfgFmjVsZEwjFnzlvdncAmYVPgC_8bnt51P-rqhttQenWSDa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ab9pCRY_0BkZ8A&token_type=Bearer&expires_in=3600&scope=openid+email&state=x0QehzYRCF3461TVZYX6EjOynR298VG5wkj5DAaFDRgfdhYXtUu2cGZdjyCF61Er

Expected behavior

const accessToken = await this.oktaAuth.getAccessToken(); should give me the accesstoken

Extra information about the use case/user story you are trying to implement

const accessToken = await this.oktaAuth.getAccessToken(); const getconfig = await this.oktaAuth.getOktaConfig(); console.log('getconfig------------',getconfig); console.log('accessToken-----',accessToken); this.isAuthenticated = await this.oktaAuth.isAuthenticated(); console.log('this.isAuthenticated----',this.isAuthenticated); if (!!accessToken) { this.oktaAuth.getUser().then((claims:UserClaims) => {

  });

access token always gives undefined in enviroment whereas everything is working as expected in the local.

{ path: 'user-manager/callback', component: OktaCallbackComponent,

},

this is callback path..the same was configured in okta application

Previously I was using v3 of @okta/okta-angular .there I get only state and code in url .It was also working fine in local so, I switched to v1 .Thought it might help.

Environment

sksaifuddin commented 3 years ago

I am also the facing the same issue, can anyone help please..

oleksandrpravosudko-okta commented 3 years ago

Thanks for reporting this issue, @yashwanth-yenugu. I will investigate and get back to you once I have more details on a potential root cause.

oleksandrpravosudko-okta commented 3 years ago

@yashwanth-yenugu, I was not able to reproduce the behaviour you described in non-localhost environment a few clarifying questions to help with further investigation:

yashwanth-yenugu commented 3 years ago

Thank you for responding .I have attached the file which contains all the details we are using to integrate with okta agular-okat.txt

there are no error messages in the developer tools. I can see the cookies as well.

oleksandrpravosudko-okta commented 3 years ago

thanks for following up, @yashwanth-yenugu my next questions and suggestions: