Skip to content

Commit

Permalink
Oauth: add post log out docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 authored and ntarocco committed Jul 28, 2023
1 parent fc691be commit f18b240
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/customize/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,29 @@ Properties marked with `True` (or omitted) in the precedence mask will be taken
from the authentication server user information payload if available, while properties marked
with `False` will be taken from the user input in the registration form.

### Defining post logout url

By default, upon logging out, the application will disconnect you only from itself. However, if you logged in through an external provider, logging out from the application will not automatically log you out from that provider. To address this, you can define a `logout_url` when setting up the remote apps:

```diff
_keycloak_helper = KeycloakSettingsHelper(
title="CERN",
description="CERN SSO authentication",
...
+ logout_url="your_app/logout",
),
)
```

After setting the `logout_url`, it is necessary to include the following configuration variable:

```python
SECURITY_POST_LOGOUT_VIEW = "/oauth/logout"
"""Required by invenio-oauthclient to be able to set logout urls for the remote apps."""
```

This will redirect to the appropriate `logout_url` for each of the enabled remotes in the instance.

## Security

For increased security, you should define the following in your `invenio.cfg`:
Expand Down

0 comments on commit f18b240

Please sign in to comment.