AWS 中国区和国际区的配置稍有不同,本文讲述使用 Authing SAML2 IdP 登录 AWS 中国区控制台的相关配置。
如果你还没有 Authing 账号,请先注册 (https://console.authing.cn)一个 Authing 账号、新建一个用户池并创建一个应用。
进入控制台 > 应用 > 应用列表,找到你的应用,点击「配置」。
{
"audience": "https://signin.amazonaws.cn/saml",
"recipient": "https://signin.amazonaws.cn/saml",
"destination": "https://signin.amazonaws.cn/saml",
"mappings": {
"email": "https://aws.amazon.com/SAML/Attributes/RoleSessionName"
},
"digestAlgorithm": "http://www.w3.org/2000/09/xmldsig#sha1",
"signatureAlgorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1",
"authnContextClassRef": "urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified",
"lifetimeInSeconds": 3600,
"signResponse": false,
"nameIdentifierFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress",
"samlRequestSigningCert": ""
}
最下方的自定义 SAML Response 属性添加一条,Name 属性为:https://aws.amazon.com/SAML/Attributes/Role,类型选择 Uri,值按照此格式填写 arn:aws-cn:iam::<AWS 账号 ID>:role/<角色名称>,arn:aws-cn:iam::<AWS 账号 ID>:saml-provider/<身份提供商名称>。点击「保存」。
最后下载 SAML2 Identity Provider 的元数据文档: https://core.authing.cn/api/v2/saml-idp/<应用 ID>/metadata
登录 AWS IAM 控制台 (opens new window),进入访问管理 > 身份提供商,点击「创建提供商」。
在浏览器访问:https://core.authing.cn/api/v2/saml-idp/<应用 ID>
选择一种方式进行登录。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.