Skip to content

Commit 527c4e6

Browse files
committed
docs: add reference to OIDC authorisation
1 parent beea173 commit 527c4e6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/docs/CONFIGURE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,11 @@ spring:
186186

187187
You need to get the client-id and the secret from your OIDC IDP. You must NEVER store them in the container image. Always fetch them during runtime of the container from a secret vault, such as Hashicorp Vault or AWS Secrets Manager, before starting the web application!
188188

189+
You can also configure an [OIDC Claims to Role Mapping](#oidc-claims-to-role-mapping) (see below). This allows you to authorise access to your controllers or even more fine-granular access using declarative policies with Spring Security Authorities in your application.
190+
189191
Find a complete configuration example in [../../config/config-oidc.yml](../../config/config-oidc.yml).
190192

193+
191194
### Session cookie
192195
At the moment, we need to configure the session cookie with a specific samesite policy so that it works with SAML. We use the following configuration.
193196
```
@@ -267,6 +270,8 @@ application:
267270
You can find a complete example in [](../../config/config-saml2.yml).
268271

269272
## OIDC Claims to Role Mapping
273+
This allows you to authorise access within your application when you configure [OIDC for authentication](#authentication-oidc) (see above).
274+
270275
By default OIDC claims "scope, scp" are made available as a Spring Authority with the prefix "SCOPE_". These come from the [OIDC IdToken](https://openid.net/specs/openid-connect-core-1_0-final.html#StandardClaims). However, often additional claims are needed for Spring Security Authorities (roles), e.g. "groups" in a user directory. Those usually do not come from the OIDC IdToken, but only from the [UserInfo Endpoint](https://openid.net/specs/openid-connect-core-1_0-final.html#UserInfoResponse). You can configure here for both, IdToken and UserInfo endpoint, which claims should be mapped to Spring Security Authorities. Furthermore, you can configure for each claim how they are mapped to authorities. By default, it is assumed that the claims are JSON String arrays, but in case they are string you can define how they are extracted from the String using the claimsSeparatorMap. For example, lets assume the claim "groups" is returned by the UserInfo Endpoint as one String representing a comma-separated list groups. You can define as a separator the "," and the claim is then split accordingly so that you do not have the list of groups as one Spring Security Authority, but multiple representing each one of the groups.
271276

272277
Independent of this you can also map user attributes to Spring Security Authorities.

0 commit comments

Comments
 (0)