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

feat(cognito): OpenID Connect identity provider #20241

Merged
merged 15 commits into from
May 31, 2022

Conversation

jogold
Copy link
Contributor

@jogold jogold commented May 6, 2022

Add the UserPoolIdentityProviderOidc class to create an OpenID Connect
identity provider for user pools.


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Add the `UserPoolIdentityProviderOidc` class to create an OpenID Connect
identity provider for user pools.
@gitpod-io
Copy link

gitpod-io bot commented May 6, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team May 6, 2022 13:59
@github-actions github-actions bot added the p2 label May 6, 2022
Copy link
Contributor

@corymhall corymhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @jogold! Just a couple of minor comments.


const resource = new CfnUserPoolIdentityProvider(this, 'Resource', {
userPoolId: props.userPool.userPoolId,
providerName: props.name,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to use physicalName here and generate one if the user doesn't provide one? It doesn't look like OIDC has a specific name requirement like the others.

Copy link
Contributor Author

@jogold jogold May 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean

providerName: props.name ?? this.node.id,

the provider name is required in AWS::Cognito::UserPoolIdentityProvider (CF) and UserPoolIdentityProviderOidc doesn't extend Resource directly so there is no physical name prop?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh I missed that it wasn't extending Resource directly. How about:

providerName: props.name || Lazy.string({ produce: () => Names.uniqueId(this) }),

Copy link
Contributor Author

@jogold jogold May 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id might be a better default since the provider name is limited to 32 chars? (could add validation)

packages/@aws-cdk/aws-cognito/lib/user-pool-idps/oidc.ts Outdated Show resolved Hide resolved
@mergify mergify bot dismissed corymhall’s stale review May 27, 2022 13:31

Pull request has been modified.

@jogold jogold requested a review from corymhall May 28, 2022 07:44
@jogold jogold requested a review from corymhall May 31, 2022 12:37
@mergify
Copy link
Contributor

mergify bot commented May 31, 2022

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: cba729c
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 33acc7c into aws:master May 31, 2022
@mergify
Copy link
Contributor

mergify bot commented May 31, 2022

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

mergify bot pushed a commit that referenced this pull request Sep 9, 2022
Adds a construct for a SAML user pool identity provider.

I based much of this off of #20241, as the OIDC and SAML identity pool providers share e.g. the length limitations on provider names.

For the integration test, you have to specify a valid SAML metadata URL or XML document, or the stack won't be created. I used a sample URL from the [samling](https://fujifish.github.io/samling/samling.html) project, but this could be changed if anyone has a better suggestion.

----

### All Submissions:

* [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [X] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [X] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Kruspe pushed a commit to DavidSchwarz2/aws-cdk that referenced this pull request Sep 13, 2022
Adds a construct for a SAML user pool identity provider.

I based much of this off of aws#20241, as the OIDC and SAML identity pool providers share e.g. the length limitations on provider names.

For the integration test, you have to specify a valid SAML metadata URL or XML document, or the stack won't be created. I used a sample URL from the [samling](https://fujifish.github.io/samling/samling.html) project, but this could be changed if anyone has a better suggestion.

----

### All Submissions:

* [X] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [X] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [X] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants