OpenID Connect
In case you want to connect your WissKI to some Identity Provider (IdP) to enable users to login with federated accounts, this howto will guide you to though the process on how to set up an IdP and connect your WissKI via OpenID Connect (OIDC).
Requirements¶
- A running Drupal/WissKI instance with
- A running external IdP (we will use Keycloak in this example)
Keycloak Steps¶
- Follow the Keycloak documentation to set up a new
Realm. - Create a new
Clientin this realm:- General Settings:
Client Type: OpenID ConnectClient ID: usually the full URL of your Drupal/WissKI instance e.g. https://my.wisski.my-domain.com- You can leave the rest empty/as is

- Capability Config:
- Turn
Client authenticationon - leave rest as is

- Turn
- Login Settings:
Root URL: set the Domain of your Drupal/WissKI instanceHome URL:/Valid redirect URLs:/*- leave rest as is

- General Settings:
- After you have created the client select it in the client list, navigate to the
Credentialstab and copy theClient Secretfor later use. - Also open the
OpenID Endpoint Configurationin a new tab. (You can find this by Clicking onRealm settingson the left sidebar, then scrolling down to theEndpointssection and clicking onOpenID Endpoint Configuration(You can also just visitrealms/REALM_NAME/.well-known/openid-configurationon your Keycloak, whereREALM_NAMEis the name you chose for the realm you created). This should open a page that displays a JSON file containing information about the endpoint and should look like this:
WissKI/Drupal Steps¶
- Get into the console
- Download the OpenID Connect/OAuth Client Module using
composer- usually
composer require drupal/openid_connectshould to the trick
- usually
- Enable the module using
drush:drush en openid_connect(Alternatively you can enable it though theExtendinterface in Drupal https://my.wisski.my-domain.com/admin/modules) - Configure the OIDC module: https://my.wisski.my-domain.com/admin/config/people/openid-connect
- Add a new
Generic Oauth 2.0Client
- Configuration:
Name: Will be displayed on the login pageClient ID: Use the Client ID you set in the Keycloak clientClient secret: The secret you copied from earlierAllowed domains:*Endpoints: Copy the values from theOpenID Endpoint Configurationyou have open in another tab.Scopes: openid email groups
- Add a new
- In the Drupal
OpenID Connect Settings(admin/config/people/openid-connect/settings) setOpenID buttons display in user login formto either replace the default login on the login page, or be displayed above, or below the default login fields. - In case you have any roles in the Keycloak that you want to map to Drupal roles you can do that in the
EXPERIMENTAL - User role mappingsection.