oauth2_proxy icon indicating copy to clipboard operation
oauth2_proxy copied to clipboard

Integrating oauth2_proxy with AWS Cognito

Open AdeOpe opened this issue 6 years ago • 3 comments

Hi, thanks for oauth2_proxy. I managed to get oauth2_proxy to work with AWS cognito ;)

So I just tried to submit a feature branch but i get permission denied.

in the branch i added the following to the readme:

`

AWS with Cognito User pool OIDC

Example on how to integrate oauth-proxy with AWS cognito user pool

  1. Setup your AWS Cognito User pool - https://docs.aws.amazon.com/cognito/latest/developerguide/getting-started-with-cognito-user-pools.html

  2. Launch oauth2_proxy with the following

    -provider=oidc -client-id=<YOUR_CLIENT_ID> -client-secret=<YOUR_CLIENT_SECRET> -redirect-url=https://<YOUR_DNS_FROM_ROUTE_53>/oauth2/callback -login-url=https://<YOUR_COGNITO_DOMAIN_PREFIX>.auth.<YOUR_AWS_REGION>.amazoncognito.com/oauth2/authorize -profile-url=https://<YOUR_COGNITO_DOMAIN_PREFIX>.auth.<YOUR_AWS_REGION>.amazoncognito.com/oauth2/userInfo -redeem-url=https://<YOUR_COGNITO_DOMAIN_PREFIX>.auth.<YOUR_AWS_REGION>.amazoncognito.com/oauth2/token -scope=openid -cookie-secure=false -upstream=<URL_OF_THE_APP_YOU_WANT_TO_HIT> -email-domain=* -cookie-secret=<SET_YOUR_COOKIE_SECRET> -http-address=<SET_YOUR_HTTP_ADDRESS> `

Could you please add the above to the README, if you think its useful for other people?

AdeOpe avatar Nov 27 '18 08:11 AdeOpe

How did you create the user pool?

falfaro avatar Jan 07 '19 12:01 falfaro

i scripted it using terraform https://www.terraform.io/docs/providers/aws/d/cognito_user_pools.html

or you can set it up manually using (I added this link in my above comment) https://docs.aws.amazon.com/cognito/latest/developerguide/getting-started-with-cognito-user-pools.html

AdeOpe avatar Jan 07 '19 13:01 AdeOpe

Do you mind sharing your Terraform parameters?

Also, my instance of oauth2_proxy crashes because I am not supplying the --oidc-issuer-url. Any ideas?

falfaro avatar Jan 07 '19 14:01 falfaro