简体   繁体   English

AWS Cognito:更改 aws_user_pools_web_client_id

[英]AWS Cognito: changing the aws_user_pools_web_client_id

I need to change the value of aws_user_pools_web_client_id so that it points to a different web client id.我需要更改 aws_user_pools_web_client_id 的值,使其指向不同的 web 客户端 ID。 Obviously, I cannot simply edit the aws-exports file, so how do I correctly change this value?显然,我不能简单地编辑 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;

Are you looking to be able to configure this in advance and change it with environments?您是否希望能够提前进行配置并根据环境进行更改?

If so then you can use the following syntax and use variables - react for example would use the process.env.REACT_APP_...... syntax如果是这样,那么您可以使用以下语法并使用变量 - 例如反应将使用 process.env.REACT_APP_...... 语法

Amplify.configure({
  Auth: {
    region: "",
    userPoolId: "",
    userPoolWebClientId: ""
  }
});

which are listed in full at congitocongito上完整列出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM