How to use Keycloak as an external IdP for your own nmaas instance
Requirements
Overview
nmaas allows users to log in not only via a local account, but also using external identity providers that comply with the OpenID Connect (OIDC) standard. This allows administrators to integrate existing authentication systems, such as Keycloak, without having to change the authorization logic on the platform itself.
Article objective
This is done in 2 steps:
- Keycloak realm and client configuration
- Filling in the required environmental variables in the nmaas-platform
Keycloak configuration
Create Realm
- Log in to the administrator panel in Keycloak and select
Manage realms.
If your realm is ready, you can proceed to creating a client.

- Create a new realm for nmaas.

- Fill in the name for the new realm, remember to check enable realm

Create client
- Select clients list

- Create new client

- The required information in the form will be the
ClientId, which will be in the nmaas-platform as the environment variableOIDC_CLIENT_ID.

- In the next step, select
Standard flowto give the client access to OpenID Connect andClient authenticationto set the access type as confidential access.

- In the last step of creating a client to enable the nmaas-platform to log in via Keycloak, specify
Valid redirect URIsrelative to the nmaas-platform service.

- After creating the client, go to the
Credentialstab to copy theClient secret. It will be needed for theOIDC_CLIENT_SECRETenvironment variable.

- The last environment variable from Keycloak is
OIDC_ISSUER_URI. It can be accessed in theRealm settingstab in theEndpointssection under theOpenID Endpoint Configurationlink.

The nmaas-platform environmental variables
If you already have a working Keycloak instance with a configured realm and client, you need to specify the following environment variables when deploying the nmaas-platform:
| ENV | Value |
|---|---|
PORTAL_SSO_ALLOWED_FLAG |
Must be set to true |
OIDC_CLIENT_ID |
Client ID from Keycloak |
OIDC_CLIENT_SECRET |
Secret from the client credentials |
OIDC_ISSUER_URI |
Issuer URI from realm metadata |
When installing nmaas using Helm (nmaas-chart) alter the values file with proper parameters.
Other providers
To integrate a different OIDC provider, you must identify equivalent parameters:
clientIDclient secretissuer URI
nmaas requires the provider to supply the following claims:
preferred_usernameemailfamily_namegiven_namesub
If the provider does not expose these claims, integration may require custom mapping on their side.