Skip to content
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

add keycloak sso documentation #151

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

goseind
Copy link
Member

@goseind goseind commented Feb 16, 2023

This PR adds documentation for the new Keycloak SSO login option.

fixes reanahub/reana-server#513

@goseind goseind self-assigned this Feb 16, 2023
@goseind goseind marked this pull request as ready for review March 16, 2023 11:16
@mdonadoni
Copy link
Member

mdonadoni commented Jul 7, 2023

Note for reviewer: The commits need to be squashed before merging

@mdonadoni mdonadoni linked an issue Jul 10, 2023 that may be closed by this pull request
Copy link
Member

@giuseppe-steduto giuseppe-steduto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I just added a few minor cosmetic comments to keep the style of the documentation consistent.

@@ -24,8 +24,64 @@ Helm value accordingly.

## User registration via Single Sign-On

Handling of users with Single Sign-On (SSO) is also possible. Currently,
this is only available for CERN deployments via [`components.reana_ui.cern_sso`](https://github.com/reanahub/reana/tree/master/helm/reana)
Handling of users with Single Sign-On (SSO) is also possible. Currently SSO is supported for CERN as well as for any third-party SSO provider which supports [Keycloak](https://www.keycloak.org/).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Handling of users" may have some negative connotations; perhaps say "User access through Single-Sign-On (SSO) authentication is also possible". (More neutral.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REANA currently supports CERN SSO as well as any third-party...

### Keycloak Single Sign-On Configuration

First of all, to integrate REANA with your Keycloak instance, you need to create a new client from the Keycloak's admin dashboard.
There are many configuration options, but these are the minimal changes you have to make:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many configurations options; the following are the minimal ones that you should set:

First of all, to integrate REANA with your Keycloak instance, you need to create a new client from the Keycloak's admin dashboard.
There are many configuration options, but these are the minimal changes you have to make:

- _Valid Redirect URIs_ should be set to `https://<your-reana-hostname>/api/oauth/authorized/keycloak/` (see Keycloak's [Access Settings](https://www.keycloak.org/docs/latest/server_admin/#access-settings))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use semicolon after list item, and full stop after last item, following traditional English separator style for long lists:

- first long phrase;
- second long phrase.;
- third final phrase.

First of all, to integrate REANA with your Keycloak instance, you need to create a new client from the Keycloak's admin dashboard.
There are many configuration options, but these are the minimal changes you have to make:

- _Valid Redirect URIs_ should be set to `https://<your-reana-hostname>/api/oauth/authorized/keycloak/` (see Keycloak's [Access Settings](https://www.keycloak.org/docs/latest/server_admin/#access-settings))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we add example.org domain?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used reana.example.org and keycloak.example.org

- _Valid Redirect URIs_ should be set to `https://<your-reana-hostname>/api/oauth/authorized/keycloak/` (see Keycloak's [Access Settings](https://www.keycloak.org/docs/latest/server_admin/#access-settings))
- _Client authentication_ should be enabled in order to get the client ID and the client secret (see Keycloak's [Confidential client credentials](https://www.keycloak.org/docs/latest/server_admin/#_client-credentials))

You can then configure REANA to use your third-party SSO provider by adding an item with the needed configuration to the [`login`](https://github.com/reanahub/reana/tree/master/helm/reana) list in the Helm values:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the beginning of this section, we say "your Keycloak instance". Here, we say "your third-party SSO provider". We could harmonise the two to say "Your Keycloak instance" everywhere, or "your Keycloak provider", etc.
(The SSO is used above in the little introductory text.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed to "your Keycloak instance" everywhere

userinfo_url: "https://<your-provider-hostname>/auth/realms/your-realm/protocol/openid-connect/userinfo"
```

Then specify the provided client ID and client secret under the [`secrets.login`](https://github.com/reanahub/reana/tree/master/helm/reana) Helm value:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"provided" may be too abstract. We could rephrase to be more concrete, for example:

You should then take the values of the SSO client ID and the SSO client secret that you obtained when you created your SSO application in the Keycloak dashboard and add it under the secrets.login Helm value:

```yaml
secrets:
login:
your-provider:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we use your_provider to avoid dashes vs underscores?

Alternatively, we can call it myprovider without any spaces, which should make the YAML snippet more easily usable by copy/paste?

Or something "more realistic" such as reana.example.org, sso.example.org.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed it to "yourprovider". I have kept "provider" in this case to avoid confusion with "keycloak" that is used everywhere else, as this value can be fully customised by the user.

consumer_secret: <your-client-secret>
```

!!! note
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note could be turned into a regular text:

Note that the key "your-provider" must match the internal identifier name you have chosen above as the name of your SSO provider.


!!! note

Note that `secrets.login` is a dictionary, whose key must match the `name` provided in the `login` list, which in this example is `your-provider`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This starts a new "section" in the configuration, so we can say:

Furthermore, given that...


![ui-sso-keycloak](../../../images/ui-sso-keycloak.png)

For further information on how to use Keycloak, see [Keycloak’s own documentation](https://www.keycloak.org/docs/latest/server_admin/#_oidc_clients).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see Keycloak's documentation

(no need to say "own")

@mdonadoni mdonadoni merged commit 7e2711a into reanahub:master Aug 18, 2023
2 checks passed
@mdonadoni
Copy link
Member

Rebased, squashed and merged. Thanks @goseind for the great job!

@goseind
Copy link
Member Author

goseind commented Aug 18, 2023

Rebased, squashed and merged. Thanks @goseind for the great job!

Perfect, thank you for reviewing and giving it the final touch 🥳

@goseind goseind deleted the issue-513-generic-oidc branch August 18, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

login: add docs for Keycloak SSO login: support for generic OIDC Keycloak
4 participants