Not getting cognito Access token after login with amzon cognito domain UI (generated from userpool)?

你离开我真会死。 提交于 2019-12-08 09:23:14

问题


I'm not getting the access token from aws cognito user pool after authentication, I'm getting code in web url instead of token.

The step I have done are following :-

Step 1: Created an User pool and setup all the requirements.

Step 2: Added Identity providers credential in userpool left navigation bar -> Federation -> Identity Providers(Facebook, google plus).

Step 3: Done Attribute mapping(User pool left Navigation bar -> Federation -> Attribute Mapping).

Step 4: Enabled Identity Providers and added callback URI(User pool left Navigation bar App Integration -> App Client Setting -> Enabled Identity Providers)(Allowed OAuth Flows -> Authorization code grant)

Step 5: Created URI domain name (User pool left Navigation bar App Integration -> Domain Name) and added this domain in Facebook app as well as in google plus account(https://XXXXXXXXX.auth.us-east-1.amazoncognito.com/oauth2/idpresponse).

Step 6: Open the hosted domain by aws in browser (https://XXXXXXXXX.auth.us-east-1.amazoncognito.com/login?response_type=code&client_id=abcdefghi&redirect_uri=https://abcdefg)

Step7: Login in into open UI and it redirect to successful login with an code in query parameter, not the access token how can I get the access token now in my application.

Please help me.


回答1:


Authorization code grant flow will only vend an authorization code to your application. This code can be exchanged for tokens with the Cognito token endpoint.

If you want tokens vended directly to your app, you should use Implicit grant flow instead.

Reference documentation: http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-idp-settings.html



来源:https://stackoverflow.com/questions/46709352/not-getting-cognito-access-token-after-login-with-amzon-cognito-domain-ui-gener

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!