Add Github Identity Provider to AWS Cognito

Viewed 515

I have created a Github OAuth app and I am trying to add the app as an OIDC application to AWS Cognito.

However, I cannot find a proper overview about the endpoints and data to fill in anywhere in the Github Docs.

The following fields are required:

Issuer -> ?

Authorization endpoint => https://github.com/login/oauth/authorize (?)

Token endpoint => https://github.com/login/oauth/access_token (?)

Userinfo endpoint => https://api.github.com/user (?)

Jwks uri => ?

I couldn't find the Jwks uri anywhere. Any help would be highly appreciated.

2 Answers

GitLab 14.7 (January 2022) might help:

OpenID Connect support for GitLab CI/CD

Connecting GitLab CI/CD to cloud providers using environment variables works fine for many use cases.
However, it doesn’t scale well if you need advanced permissions management or would prefer a signed, short-lived, contextualized connection to your cloud provider.

GitLab 12.10 shipped initial support for JWT token-based connection (CI_JOB_JWT) to enable HashiCorp Vault users to safely retrieve secrets. That implementation was restricted to Vault, while the logic we built JWT upon opened up the possibility to connect to other providers as well.

In GitLab 14.7, we are introducing a CI_JOB_JWT_V2 environment variable that can be used to connect to AWS, GCP, Vault, and likely many other cloud services.
Please note that this is an alpha feature and not ready for production use. Your feedback is welcomed in this epic.

For AWS specifically, with the new CI_JOB_JWT_V2 variable, you can connect to AWS to retrieve secrets, or to deploy within your account. You can also manage access rights to your cluster using AWS IAM roles.
You can read more on setting up OIDC connection with AWS.

The new variable is automatically injected into your pipeline but is not backward compatible with the current CI_JOB_JWT.
Until GitLab 15.0, the CI_JOB_JWT will continue to work normally but this will change in a future release. We will notify you about the change in time.
The secrets stanza today uses the CI_JOB_JWT_V1 variable. If you use the secrets stanza, you don’t have to make any changes yet.

https://about.gitlab.com/images/14_7/oidc.drawio.png -- OpenID Connect support for GitLab CI/CD

See Documentation and Issue.

Related