-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
16 changed files
with
4,723 additions
and
3,899 deletions.
There are no files selected for viewing
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 was deleted.
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 |
---|---|---|
@@ -1,21 +1,26 @@ | ||
# Server plugin: Authorization "keycloak" | ||
|
||
Please see our documentation on the [authorization feature](./feature_auth.md) for more complete details. | ||
Please see our documentation on the [authorization feature](./user-management.md) for more complete details. | ||
|
||
Note that configuring this requires the frontend to be configured to obtain access tokens at the relevant auth server. | ||
|
||
The configuration has the following key-value pairs: | ||
|
||
| Key | Description | Required | | ||
| ----------- | ----------------------------------------------------------------------- | -------- | | ||
| issuer | Issuer URL for OIDC Discovery with external IAM System | True | | ||
| Key | Description | Required | | ||
| ----------- | ----------------------------------------------------------------------- | ------------------- | | ||
| issuer | Issuer URL for OIDC Discovery with external IAM System | True | | ||
| audience | Expected audience value in received JWT tokens | False (Recommended) | | ||
|
||
A sample configuration file for syntactic referense is below: | ||
|
||
```hcl | ||
UserManagement "KeycloakAuth" { | ||
plugin_data { | ||
issuer = "http://localhost:8080/realms/tornjak" | ||
audience = "tornjak-backend" | ||
} | ||
} | ||
``` | ||
|
||
NOTE: If audience field is missing or empty, the server will log an error and NOT perform an audience check. | ||
It is highly recommended `audience` is populated to ensure only tokens meant for the Tornjak Backend are accepted. |
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
160 changes: 69 additions & 91 deletions
160
examples/keycloak/client/tornjak-keycloak-client-import.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 |
---|---|---|
@@ -1,93 +1,71 @@ | ||
{ | ||
|
||
"clientId": "Tornjak-React-auth", | ||
"surrogateAuthRequired": false, | ||
"enabled": true, | ||
"alwaysDisplayInConsole": true, | ||
"clientAuthenticatorType": "client-secret", | ||
"secret": "**********", | ||
"redirectUris": [ | ||
"*" | ||
], | ||
"webOrigins": ["*"], | ||
"notBefore": 0, | ||
"bearerOnly": false, | ||
"consentRequired": false, | ||
"standardFlowEnabled": true, | ||
"implicitFlowEnabled": false, | ||
"directAccessGrantsEnabled": false, | ||
"serviceAccountsEnabled": true, | ||
"authorizationServicesEnabled": false, | ||
"publicClient": true, | ||
"frontchannelLogout": true, | ||
"clientId": "Tornjak-React-auth", | ||
"name": "Tornjak", | ||
"description": "", | ||
"rootUrl": "", | ||
"adminUrl": "", | ||
"baseUrl": "", | ||
"surrogateAuthRequired": false, | ||
"enabled": true, | ||
"alwaysDisplayInConsole": true, | ||
"clientAuthenticatorType": "client-secret", | ||
"redirectUris": [ | ||
"http://localhost:3000/*" | ||
], | ||
"webOrigins": [ | ||
"*" | ||
], | ||
"notBefore": 0, | ||
"bearerOnly": false, | ||
"consentRequired": false, | ||
"standardFlowEnabled": true, | ||
"implicitFlowEnabled": false, | ||
"directAccessGrantsEnabled": false, | ||
"serviceAccountsEnabled": false, | ||
"publicClient": true, | ||
"frontchannelLogout": true, | ||
"protocol": "openid-connect", | ||
"attributes": { | ||
"oidc.ciba.grant.enabled": "false", | ||
"backchannel.logout.session.required": "true", | ||
"post.logout.redirect.uris": "http://localhost:3000/*", | ||
"display.on.consent.screen": "false", | ||
"oauth2.device.authorization.grant.enabled": "false", | ||
"backchannel.logout.revoke.offline.tokens": "false" | ||
}, | ||
"authenticationFlowBindingOverrides": {}, | ||
"fullScopeAllowed": true, | ||
"nodeReRegistrationTimeout": -1, | ||
"protocolMappers": [ | ||
{ | ||
"name": "tornjak-backend-aud", | ||
"protocol": "openid-connect", | ||
"attributes": { | ||
"saml.assertion.signature": "false", | ||
"saml.force.post.binding": "false", | ||
"saml.multivalued.roles": "false", | ||
"saml.encrypt": "false", | ||
"oauth2.device.authorization.grant.enabled": "false", | ||
"backchannel.logout.revoke.offline.tokens": "false", | ||
"saml.server.signature": "false", | ||
"saml.server.signature.keyinfo.ext": "false", | ||
"use.refresh.tokens": "true", | ||
"exclude.session.state.from.auth.response": "false", | ||
"oidc.ciba.grant.enabled": "false", | ||
"saml.artifact.binding": "false", | ||
"backchannel.logout.session.required": "true", | ||
"client_credentials.use_refresh_token": "true", | ||
"saml_force_name_id_format": "false", | ||
"saml.client.signature": "false", | ||
"tls.client.certificate.bound.access.tokens": "false", | ||
"saml.authnstatement": "false", | ||
"display.on.consent.screen": "false", | ||
"saml.onetimeuse.condition": "false" | ||
}, | ||
"authenticationFlowBindingOverrides": {}, | ||
"fullScopeAllowed": false, | ||
"nodeReRegistrationTimeout": -1, | ||
"protocolMappers": [ | ||
{ | ||
|
||
"name": "Client IP Address", | ||
"protocol": "openid-connect", | ||
"protocolMapper": "oidc-usersessionmodel-note-mapper", | ||
"consentRequired": false, | ||
"config": { | ||
"user.session.note": "clientAddress", | ||
"id.token.claim": "true", | ||
"access.token.claim": "true", | ||
"claim.name": "clientAddress", | ||
"jsonType.label": "String" | ||
} | ||
}, | ||
{ | ||
|
||
"name": "Tornjak", | ||
"protocol": "openid-connect", | ||
"protocolMapper": "oidc-usersessionmodel-note-mapper", | ||
"consentRequired": false, | ||
"config": { | ||
"user.session.note": "clientId", | ||
"id.token.claim": "true", | ||
"access.token.claim": "true", | ||
"claim.name": "clientId", | ||
"jsonType.label": "String" | ||
} | ||
}, | ||
{ | ||
|
||
"name": "Client Host", | ||
"protocol": "openid-connect", | ||
"protocolMapper": "oidc-usersessionmodel-note-mapper", | ||
"consentRequired": false, | ||
"config": { | ||
"user.session.note": "clientHost", | ||
"id.token.claim": "true", | ||
"access.token.claim": "true", | ||
"claim.name": "clientHost", | ||
"jsonType.label": "String" | ||
} | ||
} | ||
] | ||
} | ||
"protocolMapper": "oidc-audience-mapper", | ||
"consentRequired": false, | ||
"config": { | ||
"id.token.claim": "false", | ||
"access.token.claim": "true", | ||
"included.custom.audience": "tornjak-backend", | ||
"userinfo.token.claim": "false" | ||
} | ||
} | ||
], | ||
"defaultClientScopes": [ | ||
"web-origins", | ||
"acr", | ||
"profile", | ||
"roles", | ||
"email" | ||
], | ||
"optionalClientScopes": [ | ||
"address", | ||
"phone", | ||
"offline_access", | ||
"microprofile-jwt" | ||
], | ||
"access": { | ||
"view": true, | ||
"configure": true, | ||
"manage": true | ||
} | ||
} |
Oops, something went wrong.