在“ allowedOAuthFlows”处获取值“ [令牌]”未能满足约束错误

时间:2019-12-11 13:42:02

标签: amazon-cognito aws-cdk aws-userpools

我正在尝试使用AWS CDK创建AWS userpool客户端。我正在使用python代码执行此操作。 下面是我的代码-

oAuthScopes = ["access-db-data"]
    supportedIdentityProviders = ["COGNITO"]
    allowedOAuthFlows = ["Token"]

    cognito_userpool_clients = _cognito.CfnUserPoolClient(stack, id="user-pool-client-id", user_pool_id="****", client_name="client-name", 
            generate_secret=True, allowed_o_auth_scopes=oAuthScopes, supported_identity_providers=supportedIdentityProviders, allowed_o_auth_flows=allowedOAuthFlows, allowed_o_auth_flows_user_pool_client=True)

我尝试了allowedOAuthFlows值的不同选项,例如“ TOKEN”,“ token”,“ CODE”,“ Code”,“ code”。仍然无法正常工作。对于上面的代码,我得到以下错误-

validation error detected: Value '[Token]' at 'allowedOAuthFlows' failed to satisfy constraint: Member must satisfy constraint: [Member must satisfy enum value set: [implicit, client_credentials, code]] (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException;

我不知道这里出了什么问题。我将此链接引荐给-https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html#cfn-cognito-userpoolclient-allowedoauthflows

1 个答案:

答案 0 :(得分:0)

解决方案- 我已经将其值更新为“ client_credentials”,并且可以正常工作。