Skip to content

Commit fa123aa

Browse files
committed
Add documentation for backchannel logout
1 parent 0e5c964 commit fa123aa

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

docs/reference/configuration.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,13 @@ upstream_oauth2:
740740
# authorization request.
741741
#forward_login_hint: false
742742

743+
# What to do when receiving an OIDC Backchannel logout request.
744+
# Possible values are:
745+
# - `do_nothing` (default): do nothing, other than validating and logging the request
746+
# - `logout_browser_only`: Only log out the MAS 'browser session' started by this OIDC session
747+
# - `logout_all`: Log out all sessions started by this OIDC session, including MAS 'browser sessions' and client sessions
748+
#on_backchannel_logout: do_nothing
749+
743750
# How user attributes should be mapped
744751
#
745752
# Most of those attributes have two main properties:

docs/setup/sso.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ The general configuration usually goes as follows:
2424
- `response_type`: `code`
2525
- `response_mode`: `query`
2626
- `grant_type`: `authorization_code`
27+
- (optional) `backchannel_logout_uri`: `https://<auth-service-domain>/upstream/backchannel-logout/<id>`
2728
- fill the `upstream_oauth2` section of the configuration file with the following parameters:
2829
- `providers`:
2930
- `id`: the previously generated ULID
@@ -73,6 +74,25 @@ In such cases, the `human_name` parameter of the provider configuration is used
7374

7475
If there is only one upstream provider configured and the local password database is disabled ([`passwords.enabled`](../reference/configuration.md#passwords) is set to `false`), the authentication service will automatically trigger an authorization flow with this provider.
7576

77+
## Backchannel logout
78+
79+
The service supports receiving [OpenID Connect Back-Channel Logout](https://openid.net/specs/openid-connect-backchannel-1_0.html) requests.
80+
Those are notifications from the upstream provider that the user has logged out of the provider.
81+
82+
The backchannel logout URI must be configured in the provider as `https://<auth-service-domain>/upstream/backchannel-logout/<id>`, where `<id>` is the `id` of the provider.
83+
84+
By default, the authentication service will not perform any action when receiving a backchannel logout request.
85+
The [`on_backchannel_logout`](../reference/configuration.md#upstream_oauth2) option can be used to configure what to do when receiving a backchannel logout request.
86+
87+
Possible values are:
88+
89+
- `do_nothing`: Do nothing, other than validating and logging the request
90+
- `logout_browser_only`: Only log out the MAS 'browser session' started by this OIDC session
91+
- `logout_all`: Log out all sessions started by this OIDC session, including MAS 'browser sessions' and client sessions
92+
93+
One important caveat is that `logout_all` will log out all sessions started by this upstream OIDC session, including 'remote' ones done through the Device Code flow.
94+
Concretely, this means that if QR-code login is used to log in on a phone from a laptop, when MAS receives a backchannel logout request from the upstream provider for the laptop, MAS will also log out the session on the phone.
95+
7696
## Sample configurations
7797

7898
This section contains sample configurations for popular OIDC providers.
@@ -93,12 +113,11 @@ upstream_oauth2:
93113
response_mode: "form_post"
94114
token_endpoint_auth_method: "sign_in_with_apple"
95115
sign_in_with_apple:
96-
97116
# Only one of the below should be filled for the private key
98117
private_key_file: "<Location of the PEM-encoded private key file>" # TO BE FILLED
99118
private_key: | # TO BE FILLED
100119
# <Contents of the private key>
101-
120+
102121
team_id: "<Team ID>" # TO BE FILLED
103122
key_id: "<Key ID>" # TO BE FILLED
104123
claims_imports:
@@ -386,6 +405,9 @@ Follow the [Getting Started Guide](https://www.keycloak.org/guides) to install K
386405
| Client Protocol | `openid-connect` |
387406
| Access Type | `confidential` |
388407
| Valid Redirect URIs | `https://<auth-service-domain>/upstream/callback/<id>` |
408+
| Front channel logout | `Off` |
409+
| Backchannel logout URL | `https://<auth-service-domain>/upstream/backchannel-logout/<id>` |
410+
| Backchannel logout session required | `On` |
389411

390412
5. Click `Save`
391413
6. On the Credentials tab, update the fields:
@@ -554,4 +576,4 @@ To use a Rauthy-supported [Ephemeral Client](https://sebadob.github.io/rauthy/wo
554576
"access_token_signed_response_alg": "RS256",
555577
"id_token_signed_response_alg": "RS256"
556578
}
557-
```
579+
```

0 commit comments

Comments
 (0)