当前位置: 首页 > wzjs >正文

DW做的网站加载慢想建设网站前期调研报告如何写

DW做的网站加载慢,想建设网站前期调研报告如何写,东莞建网站公司案例,搜索引擎搜索器首先Cognito没有提供登录至AWS控制台的功能,然而您可以通过Cognito Identity Pool获取到IAM role的credentials [1],再另外通过代码自行将IAM role credentials拼凑成AWS控制台登录的URL [2]。 最后,由于Cognito的使用除了User Pool以及Iden…

首先Cognito没有提供登录至AWS控制台的功能,然而您可以通过Cognito Identity Pool获取到IAM role的credentials [1],再另外通过代码自行将IAM role credentials拼凑成AWS控制台登录的URL [2]。

最后,由于Cognito的使用除了User Pool以及Identity Pool的创建以及配置以外,在登录及认证的流程中都必须依赖API(通过AWS CLI或代码),因此您可以先参考文档资源 [6] 熟悉这项服务。

Q2. cognito底层是否是OIDC协议?AWS自己的协议还是Oauth?

A2. Cognito支持OAuth 2.0及OIDC [7],没有另外自己开发协议。

  1. 调用 initiate-auth [2] 手动向User Pool发起登录,获取token。
    命令:
    aws cognito-idp initiate-auth --auth-flow USER_PASSWORD_AUTH --auth-parameters USERNAME=,PASSWORD= --client-id --region
    输出:
    {
    “ChallengeParameters”: {},
    “AuthenticationResult”: {
    “AccessToken”: “”,
    “ExpiresIn”: 3600,
    “TokenType”: “Bearer”,
    “RefreshToken”: “”,
    “IdToken”: “”
    }
    }

  2. 参考文档 [3] 的「增强型流程(Enhanced flow)」调用 get-id [4] 以及 get-credentials-for-identity [5] 获取IAM role的AccessKeyId、SecretKey、以及SessionToken。
    命令:
    aws cognito-identity get-id --identity-pool-id <identity_pool_id> --logins cognito-idp..amazonaws.com/<user_pool_id>=<步骤1获取的IdToken>
    输出:
    {
    “IdentityId”: “”
    }

命令:
aws cognito-identity get-credentials-for-identity --identity-id --logins cognito-idp..amazonaws.com/<user_pool_id>=<步骤1获取的IdToken>
输出:
{
“IdentityId”: “”,
“Credentials”: {
“AccessKeyId”: “”,
“SecretKey”: “”,
“SessionToken”: “”,
“Expiration”: “”
}
}

  1. 如同一般的IAM role credentials,在credentials到期前配置并使用AccessKeyId、SecretKey、以及SessionToken [6]。

也提供文档说明 [7] 供您参考。

希望以上信息能对您有所帮助,欢迎您再度联系亚马逊技术支持。

参考文档:
[1] Common Amazon Cognito scenarios - Access AWS services with a user pool and an identity pool - https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-scenarios.html#scenario-aws-and-user-pool
[2] https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/initiate-auth.html
[3] 如何使用 Amazon Cognito 身份池授予用户访问 AWS 服务的权限? - https://repost.aws/zh-Hans/knowledge-center/cognito-identity-pool-grant-user-access
[4] https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/get-id.html
[5] https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/get-credentials-for-identity.html
[6] Configuration and credential file settings in the AWS CLI - https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-files.html
[7] Accessing AWS services using an identity pool after sign-in - https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-integrating-user-pools-with-identity-pools.html

AssumeRoleWithWebIdentity 与Identity Pool的搭配适用于当您在Identity Pool选择了Basic authflow的时候 [1]。您可以参考文档 [1] 或是 [2] 的Basic authflow(基本流程),当您使用了Basic authflow的时候,在调用了 get-id 后,您便会需要依序调用 get-open-id-token [3] 以及 assume-role-with-web-identity [4] 来去获取到IAM role的credentials,而不是使用 get-credentials-for-identity。

命令:
aws cognito-identity get-open-id-token --identity-id “” --logins cognito-idp..amazonaws.com/<user_pool_id>=<步骤1获取的IdToken>

输出:
{
“IdentityId”: “”,
“Token”: “”
}

命令:
aws sts assume-role-with-web-identity --role-arn “<指定事先配置好的IAM role>” --web-identity-token “” --role-session-name “<自定义session名>”

输出:
{
“Credentials”: {
AccessKeyId": “”,
SecretAccessKey": “”,
SessionToken": “”,
Expiration": “”
},
“SubjectFromWebIdentityToken”: “”,
“AssumedRoleUser”: {
“AssumedRoleId”: “”,
“Arn”: “”
},
“Provider”: “cognito-identity.amazonaws.com”,
“Audience”: “”
}

参考文档:
[1] Identity pools authentication flow - https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html
[2] 如何使用 Amazon Cognito 身份池授予用户访问 AWS 服务的权限? - https://repost.aws/zh-Hans/knowledge-center/cognito-identity-pool-grant-user-access
[3] https://docs.aws.amazon.com/cli/latest/reference/cognito-identity/get-open-id-token.html
[4] https://docs.aws.amazon.com/de_de/cli/latest/reference/sts/assume-role-with-web-identity.html

简单来说,通过Enhanced authflow您拿到的IAM role是由送交给Identity Pool的token内容决定,IAM role的对应也是在Identity Pool里面配置。而Basic authflow拿到的IAM role则是在调用 AssumeRoleWithWebIdentity 的时候由发起人决定。例如在Enhanced authflow您可以设置只要登录成功调用get-credentials-for-identity就返回IAM role A,没有登录就返回IAM role B。在Basic authflow由于没有mapping的功能,就必须另外配置IAM role,然后再通过 IAM 的 AssumeRoleWithWebIdentity 获取IAM role。

详细的说明以及流程图请您直接参考文档 [1],为了您的方便,也为您节录文档说明如下,由于文档的中文为机器翻译,为了避免机器翻译的翻译问题,以下将为您节录原文。

「The basic workflow gives you more granular control over the credentials that you distribute to your users. The GetCredentialsForIdentity request of the enhanced authflow requests a role based on the contents of an access token. The AssumeRoleWithWebIdentity request in the classic workflow grants your app a greater ability to request credentials for any AWS Identity and Access Management role that you have configured with a sufficient trust policy. You can also request a custom role session duration.

You can sign in with the Basic authflow in user pools that don’t have role mappings. This type of identity pool doesn’t have a default authenticated or unauthenticated role, and doesn’t have role-based or attribute-based access control configured. When you attempt GetOpenIdToken in an identity pool with role mappings, you receive the following error.

Basic (classic) flow is not supported with RoleMappings, please use enhanced flow.」

参考文档:
[1] Identity pools authentication flow - https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html


文章转载自:

http://jbRcM5Xy.jmLLh.cn
http://QcZvshGi.jmLLh.cn
http://MpAH3Vlb.jmLLh.cn
http://1nlna6VC.jmLLh.cn
http://U5gDZLY4.jmLLh.cn
http://u5SuMjOQ.jmLLh.cn
http://qr20uANp.jmLLh.cn
http://6dmb5pev.jmLLh.cn
http://3h6bB6lu.jmLLh.cn
http://EVNClnEA.jmLLh.cn
http://SHi1xbaA.jmLLh.cn
http://ZJXEAVCQ.jmLLh.cn
http://VdMpN9xm.jmLLh.cn
http://IMFHXMB7.jmLLh.cn
http://Zv7rwSsZ.jmLLh.cn
http://FBwkBVjJ.jmLLh.cn
http://AYTJyHbz.jmLLh.cn
http://6rwLsmuD.jmLLh.cn
http://Utwx9M37.jmLLh.cn
http://ex93JPrY.jmLLh.cn
http://0VSUc7xt.jmLLh.cn
http://rDC5x5QF.jmLLh.cn
http://0YgOnvug.jmLLh.cn
http://xsSy1L34.jmLLh.cn
http://s53H1Pl6.jmLLh.cn
http://f35gjRxp.jmLLh.cn
http://uKmtCuZi.jmLLh.cn
http://wMj5J8Va.jmLLh.cn
http://y8ypSsDu.jmLLh.cn
http://g7oRGwwv.jmLLh.cn
http://www.dtcms.com/wzjs/623286.html

相关文章:

  • 泉州做网站企业湖北建设企业网站价格
  • 产品宣传网站模板网站开发课程培训
  • 家居网站建设流程徐州市城乡建设局网站6
  • 建了一个网站 如何找到放图片的文件夹wordpress底部音频
  • 网站如何后台管理搜狗推广管家下载
  • 东莞网站建设市场建设银行网站首页打不开
  • 站规划在网站建设中的作用重庆网站推广流程
  • 国企网站开发wordpress支付宝会员
  • 私募基金公司网站建设淄博住房和城乡建设局网站
  • 广州番禺职业技术学院门户网站宁波网站制作公司排名
  • 济宁计算机网站建设培训班义乌电子商务有限公司
  • 页制作与网站建设技术大全石家庄建筑工程造价信息网
  • 广水市建设局网站网站分析总结
  • 姑苏区建设局网站如何解决网站兼容性问题
  • 哪些网站适合花钱做推广沧浪企业建设网站方法
  • 长沙会议网站设计哪家专业wordpress最佳固定链接
  • 村级网站建站wordpress 文章 模板下载
  • 如何在网站后台删除栏目这个域名的网站做违法的事
  • 前端面试题哪些网站上可以做seo推广的
  • 兼职 做网站装修平台网站排名前十名
  • 国外免费源码网站wordpress可以做微博
  • 名校长工作室网站建设新媒体营销是干什么的
  • 张家口网站建设济宁百姓网免费发布信息网
  • 福建建设执业资格中心网站网站的运作方式
  • 安全网站建设公司泌阳县住房和城乡建设局网站
  • 乐达网站建设佛山营销型网站
  • 贵州省住房和建设厅网网站首页泰安网络信息有限公司
  • 网站维护一般怎么做免费注册企业邮箱怎么申请
  • 用网上的文章做网站行吗.net 网站开发 教程
  • 南安市住房和城乡建设局网站人力外包项目发布平台