![](/img/trans.png)
[英]Authenticate Apollo Client to AWS AppSync with Cognito User Pools
[英]AWS Cognito: changing the aws_user_pools_web_client_id
我需要更改 aws_user_pools_web_client_id 的值,使其指向不同的 web 客戶端 ID。 顯然,我不能簡單地編輯 aws-exports 文件,那么如何正確更改此值?
/* eslint-disable */
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
const awsmobile = {
"aws_project_region": "us-east-2",
"aws_cognito_identity_pool_id": "us-east-2:8e691ef4-cca0-457e-9934-3a1846b0f28c",
"aws_cognito_region": "us-east-2",
"aws_user_pools_id": "us-east-2_cdT9gJH6x",
"aws_user_pools_web_client_id": "3i3pj4u2aq4b9bq12i64ikvv6k",
"oauth": {
"domain": "nerdhub-dev.auth.us-east-2.amazoncognito.com",
"scope": [
"phone",
"email",
"openid",
"profile",
"aws.cognito.signin.user.admin"
],
"redirectSignIn": "http://localhost:3000/",
"redirectSignOut": "http://localhost:3000/",
"responseType": "code"
},
"federationTarget": "COGNITO_USER_POOLS"
};
export default awsmobile;
您是否希望能夠提前進行配置並根據環境進行更改?
如果是這樣,那么您可以使用以下語法並使用變量 - 例如反應將使用 process.env.REACT_APP_...... 語法
Amplify.configure({
Auth: {
region: "",
userPoolId: "",
userPoolWebClientId: ""
}
});
在congito上完整列出
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.