1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2024-12-12 11:15:02 +02:00
oauth2-proxy/providers
Jakub Holy 1961424561
Feature/configurable userid claim minimal (#499)
* Add -user-id-claim to support other claims than email

Fix #431 - This is a minimal change to allow the user to configure which claim is
the source of the "user ID".

- Add the option `user-id-claim` (defaults to email)
- OIDC extracts this claim into session.Email (to be renamed later)
- providers: add `CreateSessionStateFromBearerToken` with a default impl taken from
  `GetJwtSession` and overridden by oidc to respect `user-id-claim`

Once #466 is merged, I can continue to rename SessionState.Email to .UserID
and add HTTP headers with a corresponding name.

* Apply suggestions from code review

Co-Authored-By: Joel Speed <Joel.speed@hotmail.co.uk>

* Review feedback: Don't extract claims manually

Instead, parse them twice - it might be sligtly slower but less bug-prone as the code evolves.

* Fix indentation

Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
2020-04-28 07:46:46 +01:00
..
auth_test.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
azure_test.go feature: switch Azure AD graph API to Microsoft Graph API (#440) 2020-04-12 11:53:30 +01:00
azure.go feature: switch Azure AD graph API to Microsoft Graph API (#440) 2020-04-12 11:53:30 +01:00
bitbucket_test.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
bitbucket.go Add new linters (#486) 2020-04-14 09:36:44 +01:00
digitalocean_test.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
digitalocean.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
facebook.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
github_test.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
github.go Add new linters (#486) 2020-04-14 09:36:44 +01:00
gitlab_test.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
gitlab.go Add new linters (#486) 2020-04-14 09:36:44 +01:00
google_test.go Support for client secret file. (#355) 2020-02-15 13:44:39 +00:00
google.go Add new linters (#486) 2020-04-14 09:36:44 +01:00
internal_util_test.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
internal_util.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
keycloak_test.go Implement graceful shutdown and propagate request context (#468) 2020-04-04 16:12:38 +01:00
keycloak.go Add new linters (#486) 2020-04-14 09:36:44 +01:00
linkedin_test.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
linkedin.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
logingov_test.go add login.gov provider (#55) 2019-03-20 13:44:51 +00:00
logingov.go Add new linters (#486) 2020-04-14 09:36:44 +01:00
nextcloud_test.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
nextcloud.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
oidc_test.go Feature/configurable userid claim minimal (#499) 2020-04-28 07:46:46 +01:00
oidc.go Feature/configurable userid claim minimal (#499) 2020-04-28 07:46:46 +01:00
provider_data.go Add new linters (#486) 2020-04-14 09:36:44 +01:00
provider_default_test.go Migrate to oauth2-proxy/oauth2-proxy 2020-03-29 15:40:10 +01:00
provider_default.go Feature/configurable userid claim minimal (#499) 2020-04-28 07:46:46 +01:00
providers.go Feature/configurable userid claim minimal (#499) 2020-04-28 07:46:46 +01:00