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

identity/cognito: support revocation / add custom provider #494

Closed
psychomelet opened this issue Feb 8, 2020 · 8 comments · Fixed by pomerium/documentation#50
Closed
Labels
docs Docs update required help wanted Extra attention is needed

Comments

@psychomelet
Copy link

configured following the aws cognito doc

@desimone desimone added help wanted Extra attention is needed good first issue Good for newcomers labels Feb 8, 2020
@desimone
Copy link
Contributor

desimone commented Feb 8, 2020

Hi @psychomelet ,

AWS cognito uses the default oidc configuration. Unfortunately, the OIDC spec does not provide a standardized method of token revocation. To support revocation, a custom interface would have to be created for AWS cognito (see examples in internal/identity/*) and implements their revocation method. Contributions are very welcome.

See also:

\cc @stuh84

@desimone desimone changed the title can't logout, "Bad Request: internal/identity: revoke not implemented by oidc" identity/cognito: support revocation / add custom provider Feb 8, 2020
@psychomelet
Copy link
Author

noticed another problem, I can't get groups from aws cognito, is it expected behavior too?

@desimone
Copy link
Contributor

desimone commented Feb 8, 2020

Oftentimes yes, group membership and revocation fall outside the spec. Group retrieval usually needs an extra api call, but sometimes is included as a claim.

Fortunately, there's usually not too much work to do to support a custom provider.
See okta, for example : https://github.com/pomerium/pomerium/blob/master/internal/identity/okta.go

That said, it looks like AWS supports the groups claim.

See:

@desimone
Copy link
Contributor

I may spoke to soon, per #501 , if cognito implements revocation_url per rfc8414 we could support it.

I don't have an cognito account at hand. Would you be to supply what your .well-known/openid-configuration looks like?

@desimone desimone added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed good first issue Good for newcomers labels Feb 11, 2020
@enniomara
Copy link

For anyone looking into doing group based auth in Cognito I found a way. Cognito embeds the group membership into the access token. Pomerium does have an option called allowed_idp_claims which allows for validating fields in the claim.

So validating groups in Cognito can be done using the following, where admins is a group I created in Cognito.

- from: http://from.example.com
  to: http://to.example.com
  allowed_idp_claims:
    cognito:groups:
      - admins

Maybe this should be given as an example in the Cognito example setup at https://www.pomerium.io/docs/identity-providers/cognito.html

@saltbo
Copy link

saltbo commented Mar 21, 2021

https://cognito-idp.ap-northeast-1.amazonaws.com/ap-northeast-1_mz1mLazJM/.well-known/openid-configuration

This is my .well-known/openid-configuration of cognito, It seems that there is no revocation_url .

Is there any way to implement logout? @desimone

@saltbo
Copy link

saltbo commented Mar 21, 2021

@desimone desimone removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 3, 2021
@hrishikeshdkakkad
Copy link

For anyone looking into doing group based auth in Cognito I found a way. Cognito embeds the group membership into the access token. Pomerium does have an option called allowed_idp_claims which allows for validating fields in the claim.

So validating groups in Cognito can be done using the following, where admins is a group I created in Cognito.

- from: http://from.example.com
  to: http://to.example.com
  allowed_idp_claims:
    cognito:groups:
      - admins

Maybe this should be given as an example in the Cognito example setup at https://www.pomerium.io/docs/identity-providers/cognito.html

Yes this needs to comprehensively be added into the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Docs update required help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants