OIDC-Integration¶
Overview¶
Insight can integrate with OpenID-Connect (OIDC for short).
OIDC is an open standard, integration is only tested with keycloak
.
Please follow Keycloak installation first.
In order to use OIDC with Insight Mobile and Insight Explorer, two different clients must be created on the OIDC server.
-
clientId for the insight-middleware configured in
insight.properties
- This client must be confidenial
- accessType must be
confidential
so that requests needs a client_secret (keycloak)
- accessType must be
- DirectGrantAccess (keycloak) must be enabled resp. 'resource owner password credentials grant' (OAuth2)
- Standardflow must be off (keycloak)
- ServiceAccounts must be enabled (keycloak) resp. 'client credentials grant' (OAuth2)
- A user and password must be configured
- This client must be confidenial
-
clientId for the clients configured in config.js / config.json
- This client must be public and support the
Authorization Code with PKCE
flow- accessType must be
public
so clients do not require a secret (keycloak)
- accessType must be
- DirectGrantAccess (keycloak) must be off resp. 'resource owner password credentials grant' (OAuth2)
- Standardflow must be enabled (keycloak) resp. 'Authorization Code flow' (OAuth2)
- This client must be public and support the
Configure Insight-Properties¶
In order to integrate Insight with your OIDC-Server, you must set the following properties.
oidc.server
must point to your realm's root (e.g.https://auth.local.ibfs.de/auth/realms/insight
)oidc.techuser.username
andeam.username
the technical user's usernameoidc.techuser.password
the technical user's passwordoidc.techuser.client_id
the keycloak client's name (e.g.insight-api
)oidc.techuser.client_secret
the client's secret that was copied to the clipboard in the previous paragraphoidc.techuser.authflow
tech-user uses OIDC-Login if property is set otherwise classic login- for OIDC-Login the only valid value is
Resource Owner Password Credentials
- for OIDC-Login the only valid value is
Configure Insight Clients¶
In addition, the following redirect URLs must be stored.
insightmobile://authcallback
To support Android and iOShttp://localhost:9990/authcallback
To support Insight Mobile Electronhttps://your-insight-endpoint/*
To support the browser, the URL must be changed to your insight endpoint: https://your-insight-endpoint/insight/mobile/index.html
To enable OIDC authentiaction in Insight Mobile and Insight Explorer, the clients must configured in config.json / config.js. Client Configuration
Example config.json:
{
"name": "Insight Mobile Prod",
"server": "/",
"oidc": {
"clientId": "insight-app",
"server": https://your-oidc-auth-server/path-before-well-known,
"scope": "openid"
}
}
clientId
The clientId created for Insight Mobileserver
The server property must result in an valid call like this (/.well-known/openid-configuration is attached by insight): https://your-oidc-auth-server/path-before-well-known/.well-known/openid-configurationscope
Must include openid but can be extended: openid profile email
Apache Http¶
- KeyCloak needs a dedicated hostname or alias configured in DNS i.e. auth.local.ibfs.de
- certificates for KeyCloak
- configure vhost in http_ahssl.conf
<VirtualHost auth.kcserver:443> SSLEngine on ServerName auth.kcserver:443 SSLCertificateFile "${SRVROOT}/conf/ssl/kcserver.pem" SSLCertificateKeyFile "${SRVROOT}/conf/ssl/kcserver.key" ProxyPreserveHost On ProxyRequests Off RequestHeader set X-Forwarded-Proto "https" RequestHeader set X-Forwarded-Port "443" ProxyPass / http://localhost:<kcport>/ ProxyPassReverse / http://localhost:<kcport>/ </virtualhost>