-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for role mappings on custom SSO providers. (#920)
This is done using the `role_mappings` property. Roles to be mapped are gotten from the 'warp_groups` oidc claim: ```sso_providers: - name: custom_sso label: Custom SSO provider: type: custom client_id: <client_id> client_secret: <client_secret> issuer_url: <issuer_url> scopes: ["email", "profile", "openid", "warp_groups"] #warp_groups is scope name to request for my demo case, which adds a "warpgate_groups" claim to the userinfo role_mappings: - ["warpgate:admin", "warpgate:admin"] ``` This maps the `warpgate:admin` group from OIDC to the `warpgate:admin` role. This [video on YouTube](https://youtu.be/XCYSGGCgk9Q) demonstrates the functionality --------- Co-authored-by: Eugene <inbox@null.page>
- Loading branch information
Showing
16 changed files
with
310 additions
and
42 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
{ | ||
"ClientId": "client-credentials-mock-client", | ||
"ClientSecrets": ["client-credentials-mock-client-secret"], | ||
"Description": "Client for client credentials flow", | ||
"AllowedGrantTypes": ["client_credentials", "authorization_code"], | ||
"AllowedScopes": ["openid", "profile", "email", "warpgate-scope"], | ||
"RedirectUris": ["https://127.0.0.1:8888/@warpgate/api/sso/return"], | ||
"ClientClaimsPrefix": "", | ||
"Claims": [ | ||
{ | ||
"Type": "string_claim", | ||
"Value": "string_claim_value", | ||
"ValueType": "string" | ||
}, | ||
{ | ||
"Type": "json_claim", | ||
"Value": "[\"value1\", \"value2\"]", | ||
"ValueType": "json" | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
version: '3' | ||
services: | ||
oidc-server-mock: | ||
container_name: oidc-server-mock | ||
image: ghcr.io/soluto/oidc-server-mock:latest | ||
ports: | ||
- '4011:80' | ||
environment: | ||
ASPNETCORE_ENVIRONMENT: Development | ||
SERVER_OPTIONS_INLINE: | | ||
{ | ||
"AccessTokenJwtType": "JWT", | ||
"Discovery": { | ||
"ShowKeySet": true | ||
}, | ||
"Authentication": { | ||
"CookieSameSiteMode": "Lax", | ||
"CheckSessionCookieSameSiteMode": "Lax" | ||
} | ||
} | ||
LOGIN_OPTIONS_INLINE: | | ||
{ | ||
"AllowRememberLogin": false | ||
} | ||
LOGOUT_OPTIONS_INLINE: | | ||
{ | ||
"AutomaticRedirectAfterSignOut": true | ||
} | ||
API_SCOPES_INLINE: | | ||
- Name: some-app-scope-1 | ||
- Name: some-app-scope-2 | ||
IDENTITY_RESOURCES_INLINE: | | ||
- Name: warpgate-scope | ||
ClaimTypes: | ||
- warpgate_groups | ||
# API_RESOURCES_INLINE: | | ||
# - Name: wapgate_groups | ||
# Scopes: | ||
# - warpgate | ||
USERS_CONFIGURATION_INLINE: | | ||
[ | ||
{ | ||
"SubjectId":"1", | ||
"Username":"User1", | ||
"Password":"pwd", | ||
"Claims": [ | ||
{ | ||
"Type": "name", | ||
"Value": "Sam Tailor", | ||
"ValueType": "string" | ||
}, | ||
{ | ||
"Type": "email", | ||
"Value": "sam.tailor@gmail.com", | ||
"ValueType": "string" | ||
}, | ||
{ | ||
"Type": "warpgate_groups", | ||
"Value": "[\"qa\", \"unknown\"]", | ||
"ValueType": "json" | ||
} | ||
] | ||
} | ||
] | ||
CLIENTS_CONFIGURATION_PATH: /tmp/config/clients-config.json | ||
ASPNET_SERVICES_OPTIONS_INLINE: | | ||
{ | ||
"ForwardedHeadersOptions": { | ||
"ForwardedHeaders" : "All" | ||
} | ||
} | ||
volumes: | ||
- .:/tmp/config:ro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.