Skip to content

Feat/OIDC logout #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
'check_user_validity' => {{ OIDC_CHECK_USER_VALIDITY }},
'update_user_role' => {{ OIDC_UPDATE_USER_ROLE | bool}},
];
{% if OIDC_LOGOUT_URL %}
$plugin['CustomAuth_custom_logout'] = "{{ OIDC_LOGOUT_URL }}?client_id={{ OIDC_CLIENT_ID_INNER }}&redirect_uri={{ MISP_BASEURL | urlencode }}";
{% else %}
$plugin['CustomAuth_custom_logout'] = "{{ MISP_BASEURL }}/oauth2callback?logout={{ MISP_BASEURL | urlencode }}";
{% endif %}
$plugin['CustomAuth_custom_password_reset'] = {{ OIDC_PASSWORD_RESET | str }};
{% else %}
$oidcAuth = NULL;
Expand Down
1 change: 1 addition & 0 deletions bin/misp_create_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ def parse_mysql_settings(variable_name: str, value: str) -> dict:
"OIDC_CHECK_USER_VALIDITY": Option(typ=int, default=0, validation=check_uint),
"OIDC_UPDATE_USER_ROLE": Option(typ=bool, default=True),
"OIDC_TOKEN_SIGNED_ALGORITHM": Option(),
"OIDC_LOGOUT_URL": Option(validation=check_is_url),
# Logging
"ECS_LOG_ENABLED": Option(typ=bool, default=False),
"ECS_LOG_CONSOLE": Option(typ=bool, default=True),
Expand Down
4 changes: 3 additions & 1 deletion docs/OIDC.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ OIDC authentication is not used. Instead, Apache checks if a key is valid and le
* `OIDC_CHECK_USER_VALIDITY` (optional, int, default `0`) - number of seconds, after which user will be revalidated if he is still active in IdP. Zero means that this functionality is disabled. Recommended value is `300`.
* `OIDC_UPDATE_USER_ROLE` (optional, bool, default `true`) - if disabled, manually modified role in MISP admin interface will be not changed from roles defined in OIDC
* `OIDC_TOKEN_SIGNED_ALGORITHM` (optional, string) - can be any of `RS256|RS384|RS512|PS256|PS384|PS512|HS256|HS384|HS512|ES256|ES384|ES512`, the algorithms supported by `mod_auth_openidc` (the Apache OIDC-module), leaving empty will make `mod_auth_openidc` default to `RS256`
* `OIDC_LOGOUT_URL` (optional, string) - URL of OIDC logout endpoint.

### Inner

Expand Down Expand Up @@ -111,12 +112,13 @@ This can be fixed by Backchannel logout, but currently is not supported in this

```bash
OIDC_LOGIN=yes
OIDC_PROVIDER=https://<keycloak>/auth/realms/<realm>/
OIDC_PROVIDER=https://<keycloak>/realms/<realm>/
OIDC_CLIENT_ID=misp
OIDC_CLIENT_SECRET=<client_secret>
OIDC_AUTHENTICATION_METHOD=client_secret_jwt
OIDC_CODE_CHALLENGE_METHOD=S256
OIDC_CLIENT_CRYPTO_PASS=<random string>
OIDC_OFFLINE_ACCESS=yes
OIDC_CHECK_USER_VALIDITY=600
OIDC_LOGOUT_URL=https://<keycloak>/realms/<realm>/protocol/openid-connect/logout
```