Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::Cognito::UserPoolClient-AllowedOAuthFlows #47

Closed
benbridts opened this issue Jul 31, 2019 · 6 comments
Closed

AWS::Cognito::UserPoolClient-AllowedOAuthFlows #47

benbridts opened this issue Jul 31, 2019 · 6 comments
Labels
security identity compliance IAM, Cognito, Secrets Manager, GuardDuty, etc.

Comments

@benbridts
Copy link

benbridts commented Jul 31, 2019

AllowedOAuthFlows can be set by the API, but not with CloudFormation

Create and Update are both supported without replacement.

https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateUserPoolClient.htm
https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UpdateUserPoolClient.html

Category: Security, Identity, & Compliance

@benbridts benbridts changed the title AWS::Cognito:: UserPoolClient-AllowedOAuthFlows AWS::Cognito::UserPoolClient-AllowedOAuthFlows Jul 31, 2019
@luiseduardocolon luiseduardocolon added the security identity compliance IAM, Cognito, Secrets Manager, GuardDuty, etc. label Jul 31, 2019
@nuttmeister
Copy link

Hey,

Please have a look at our custom resource for this:
https://github.com/dwtechnologies/custom-cf/tree/master/cognito/userpool-client

And us know if it doesn't work for your usecase and we would be happy to update it.

@castaway2000
Copy link

@jacintoArias documentation is inconsistent with the actual implementation. the enum expected is not the same that the wizard walks you through and cloudformation expects different values. 'token' is not one of them despite being listed in the documentation for CFT. I checked with our amazon proserv team and they confirmed that the template used was correctly following the template. this is a bug with AWS for sure.

following the documentation to the letter.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html#cfn-cognito-userpoolclient-allowedoauthflows

AND

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html#cfn-cognito-userpoolclient-allowedoauthscopes

Both these errors happen in cloudformation:
1 validation error detected: Value '[token, code]' at 'allowedOAuthFlows' failed to satisfy constraint: Member must satisfy constraint: [Member must satisfy enum value set: [implicit, client_credentials, code]] (Service: AWSCognitoIdentityProvider; Status Code: 400; Error Code: InvalidParameterException; Request ID: 35361b9f-89ef-4392-b131-53d05491a71e)

AND

Invalid scope requested: Cognito (Service: AWSCognitoIdentityProvider; Status Code: 400; Error Code: ScopeDoesNotExistException; Request ID: e645a434-a37d-4e02-a608-ea8661e151a6)

in the above errors you can clearly see that the API is inconsistent with cloudformation and the respective documentation.

@congr
Copy link

congr commented Oct 25, 2019

AllowedOAuthFlows can be set by the API, but not with CloudFormation

--> I'd like to clarify that Cloudformation supports AllowedOAuthFlows.
I know the document is not well-defined, but I also figured it out by testing a couple of days and realized cloudformation works fine. I will ask the proper team for the documentation.

You can set like this.

  CognitoUserPoolClient:
    Type: AWS::Cognito::UserPoolClient
    DependsOn: AmazonFederateIdentityProvider
    Properties:
      AllowedOAuthFlows:
        - code
      AllowedOAuthScopes:
        - email
        - openid

@benbridts
Copy link
Author

Is this not already available?

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html#cfn-cognito-userpoolclient-allowedoauthflows

It seems to have been added in august, but it isn't mentioned in the CloudFormation release notes.

Documentation update where it was added: awsdocs/aws-cloudformation-user-guide@c9b84e8#diff-09cd4c20036ee265dc44b36968ce414aR15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security identity compliance IAM, Cognito, Secrets Manager, GuardDuty, etc.
Projects
None yet
Development

No branches or pull requests

7 participants