【问题标题】:AWS Cognito: changing the aws_user_pools_web_client_idAWS Cognito:更改 aws_user_pools_web_client_id
【发布时间】:2020-11-03 23:50:06
【问题描述】:

我需要更改 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;

【问题讨论】:

    标签: javascript amazon-web-services react-native amazon-cognito aws-amplify


    【解决方案1】:

    您是否希望能够提前进行配置并根据环境进行更改?

    如果是这样,那么您可以使用以下语法并使用变量 - 例如,react 将使用 process.env.REACT_APP_...... 语法

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

    完整列表在congito

    【讨论】:

      猜你喜欢
      • 2017-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-25
      • 2020-09-28
      • 2020-06-22
      • 2021-11-28
      • 2018-08-09
      相关资源
      最近更新 更多