add first solution for nextcloud sso with keycloak
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 48 KiB |
BIN
docs/divers/devops/img/keycloak-nextcloud/social_settings.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
@ -2,3 +2,4 @@
|
|||||||
|
|
||||||
- [Déployer un site web avec Hugo](hugo.md)
|
- [Déployer un site web avec Hugo](hugo.md)
|
||||||
- [Déployer une documentation avec Mkdocs](mkdocs.md)
|
- [Déployer une documentation avec Mkdocs](mkdocs.md)
|
||||||
|
- [Keycloak as SSO for Nextcloud](keycloak-nextcloud.md)
|
||||||
|
|||||||
103
docs/divers/devops/keycloak-nextcloud.md
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
# Keycloak as SSO in Nextcloud
|
||||||
|
|
||||||
|
In this guide we will cover two methods to have SSO in Nextcloud via Keycloak.
|
||||||
|
The first one uses the plugin Social Login in Nextcloud.
|
||||||
|
The second one uses the OpenidConnect plugin.
|
||||||
|
|
||||||
|
## SSO with Social Login plugin
|
||||||
|
|
||||||
|
### Keycloak configuration
|
||||||
|
|
||||||
|
#### Create a client
|
||||||
|
|
||||||
|
We need first to create a client in keycloak, to connect to Nextcloud.
|
||||||
|
|
||||||
|
Name `Client id` as you wish.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Use the following settings:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### Create a new role in client
|
||||||
|
|
||||||
|
In **Roles** tab, we create a role admin that we will map to Nextcloud.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### Create a new protocol mapper
|
||||||
|
|
||||||
|
In **Mappers** tab, we create a mapper for roles.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### Map roles for user
|
||||||
|
|
||||||
|
Go to an admin user you created (or create an user) and map admin role we created.
|
||||||
|
|
||||||
|
Go to the **Role Mappings** tab, then select the client you created in the **Client Roles**
|
||||||
|
selection box, then click on **Add Selected** in the bottom-left to promote admin from available
|
||||||
|
to assigned roles.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
#### Check if mapping has been catched by client
|
||||||
|
|
||||||
|
Go back to client part and evaluate client scope for the admin user you just configured.
|
||||||
|
|
||||||
|
Go to your client, tab **Client Scopes**, select your user and clic on **Evaluate**.
|
||||||
|
|
||||||
|
Check the **Generated Access Token** tab to see if the user get admin role.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### Get Client Secret
|
||||||
|
|
||||||
|
Go in **Client** -> **Credentials**, to get client secret that we will need to configure nextcloud plugin.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### See Endpoints
|
||||||
|
|
||||||
|
You will also need endpoints urls to adapt Nextcloud Social Login plugin configuration.
|
||||||
|
|
||||||
|
Go in **Realm Settings** -> **General**, clic on `OpenID EndpointConfiguration`.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
You will be redirected to the API endpoint, showing you endpoits url and other infos:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
### Use Social Login
|
||||||
|
|
||||||
|
#### Install Social Login Plugin
|
||||||
|
|
||||||
|
1. In Nextcloud, go to Applications and search for Social Login.
|
||||||
|
|
||||||
|
2. Clic on Download and install.
|
||||||
|
|
||||||
|
#### Configure Social Login
|
||||||
|
|
||||||
|
1. Go to Administration Settings, where a new section has been created for Social Login.
|
||||||
|
|
||||||
|
2. Use following configuration and Save:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
3. Create a custom OpenId Connect
|
||||||
|
|
||||||
|
Use following configuration and adapt enpoints and secret.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. Reform Logout Url like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
https://keycloak.domain.ext/auth/realms/your-realm/protocol/openid-connect/logout?redirect_uri=https://nextcloud.domain.ext
|
||||||
|
```
|
||||||
|
|
||||||
|
5. Don't forget to save
|
||||||
@ -72,6 +72,7 @@ nav:
|
|||||||
- "Index": divers/devops/index.md
|
- "Index": divers/devops/index.md
|
||||||
- "Hugo": divers/devops/hugo.md
|
- "Hugo": divers/devops/hugo.md
|
||||||
- "MkDocs": divers/devops/mkdocs.md
|
- "MkDocs": divers/devops/mkdocs.md
|
||||||
|
- "Keycloak Nextcloud": divers/devops/keycloak-nextcloud.md
|
||||||
- "Interne":
|
- "Interne":
|
||||||
- "Index": divers/internal/index.md
|
- "Index": divers/internal/index.md
|
||||||
- "Imprimantes": divers/internal/install-printers.md
|
- "Imprimantes": divers/internal/install-printers.md
|
||||||
|
|||||||