Skip to content

Commit

Permalink
Merge pull request #1201 from adorsys/feat/multiple-post-logout-redir…
Browse files Browse the repository at this point in the history
…ecr-uris

Add documetation for multiple post.logout.redirest.uris
  • Loading branch information
AssahBismarkabah authored Nov 20, 2024
2 parents a5daf2e + d72652c commit 6aba75c
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
74 changes: 74 additions & 0 deletions docs/config/addind-multiple-post-logout-redirect-uris.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
## Adding Multiple `post.logout.redirect.uris` in Keycloak Configuration.

To correctly import multiple `post.logout.redirect.uris`, you should use the `##` separators to concatenate URIs into a single string. Here's a step-by-step guide on how to do this:


### Open the Import File.

First, navigate to your JSON configuration file where the realm and clients are defined.

### Add Multiple Values for `post.logout.redirect.uris`.

In the attributes section where you want to add multiple `post.logout.redirect.uris`, ensure that you use the `##` separators. Here’s an example configuration:

Here is the syntax:

```json
"attributes": {
"post.logout.redirect.uris": "https://app1.example.com/logout##https://app2.example.com/logout##https://app3.example.com/logout"
},
```

This is a simple json example that can be used to see how it works.
```json
{
"realm": "your-realm",
"clients": [
{
"clientId": "your-client-id",
"enabled": true,
"redirectUris": [
"https://app1.example.com/callback",
"https://app2.example.com/callback",
"https://app3.example.com/callback"
],
"webOrigins": [
"https://app1.example.com",
"https://app2.example.com",
"https://app3.example.com"
],
"attributes": {
"post.logout.redirect.uris": "https://app1.example.com/logout##https://app2.example.com/logout##https://app3.example.com/logout"
},
"protocol": "openid-connect",
"publicClient": false,
"standardFlowEnabled": true,
"implicitFlowEnabled": false,
"directAccessGrantsEnabled": true,
"serviceAccountsEnabled": false,
"authorizationServicesEnabled": false,
"fullScopeAllowed": true
}
]
}
```

In the above configuration, you specify multiple logout redirect URIs separated by `##`.

### Load the Configuration.

Once your configuration file is updated, load it into your Keycloak instance.

### Verify in the Keycloak Admin UI.

![output](../images/multiple-logout-post-redirect-uris.png)
After loading the configuration, check the Keycloak Admin UI to verify that the `post.logout.redirect.uris` are correctly imported with multiple values. You should see the following URIs:

- `https://app1.example.com/logout`
- `https://app2.example.com/logout`
- `https://app3.example.com/logout`

### Conclusion

By following the above steps, you can successfully add multiple `post.logout.redirect.uris` in your Keycloak configuration. This approach ensures that all specified URIs are respected during logout redirection processes.

1 change: 0 additions & 1 deletion docs/config/example-config2.md

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ nav:
- Redhat-sso compatibility: RedHat-SSO-compatibility.md
- Use Cases:
- Remote State Management: config/remote-state-management.md
- Example Config2: config/example-config2.md
- Adding Multiple post.logout.redirect.uris: config/addind-multiple-post-logout-redirect-uris.md


markdown_extensions:
Expand Down

0 comments on commit 6aba75c

Please sign in to comment.