使用amzon cognito域UI(从userpool生成)登录后是否没有获取cognito Access令牌? [英] Not getting cognito Access token after login with amzon cognito domain UI (generated from userpool)?

查看:174
本文介绍了使用amzon cognito域UI(从userpool生成)登录后是否没有获取cognito Access令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在身份验证后没有从AWS Cognito用户池获取访问令牌,我在Web URL中获取代码而不是令牌.

我完成的步骤如下:-

第1步:创建一个用户池并设置所有要求.

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

第2步:在userpool左侧导航栏中->联合->身份提供者(Facebook,google plus)中添加了身份提供者凭据.

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

第3步:完成属性映射(用户池左侧导航栏->联合->属性映射).

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

第4步:启用身份提供者并添加回调URI(左侧用户池导航栏App集成-> App客户端设置->启用身份提供者)(允许OAuth流->授权代码授予)

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)

第5步:创建URI域名(用户池留在导航栏应用程序集成"->域名"中) 并将此域添加到Facebook应用程序以及google plus帐户中( https ://XXXXXXXXX.auth.us-east-1.amazoncognito.com/oauth2/idpresponse ).

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).

步骤6:aws在浏览器中打开托管域(

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:登录到打开的UI,并使用查询参数(而不是访问令牌)中的代码重定向到成功登录,如何才能现在在我的应用程序中获取访问令牌.

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.

请帮助我.

推荐答案

Authorization code grant流将仅向您的应用程序提供授权代码.可以使用Cognito令牌端点将此代码交换为令牌.

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.

如果要将令牌直接出售给您的应用,则应改用Implicit grant流.

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

参考文档: http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-idp-settings.html

这篇关于使用amzon cognito域UI(从userpool生成)登录后是否没有获取cognito Access令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆