Practical digital identity has to be simple and reliable, yet also extensible and flexible to span various applications and contexts. Organisations differ, and so do the ways in which they authenticate users, attribute authorisations to them and then consume the resulting identity data. With that understanding in mind we figured out that a one-size-fits-all OpenID Connect IdP solution will do poorly in practice, when concrete customer needs have to be faced.
Go minimal or fully customised – the choice is yours
The OpenID Connect solution of NimbusDS was designed to make it easy for customers to become an IdP for their employees or subscribers, then customise it where they see fit:
- Fully customisable login, consent and authorisation management pages. You can stick with the default login pages, or you can design your own to suit the appearance of your company identity or customise the user experience in the browser / mobile device. Moreover, the UI pages can be hosted on any server, at any URL, written in any language such Java/JSP, PHP, RoR, etc.
- Pluggable authentication. NimbusDS supports username / password authentication out of the box, based on our existing AuthService software. You can replace it by your own authentication mechanisms, or add additional factors such as biometrics or token devices to achieve 2FA.
- User sessions. The user sessions with the OpenID Connect IdP can be configured to match your policies for session duration, idle time and maximum number of associated browsers / devices.
- Support additional scopes for other OAuth 2.0 applications. The access token issued by the OpenID Connect Server can be furnished with additional scopes, beyond the standard ones, to grant users access to other protected resources, and not just the OIDC UserInfo endpoint. The scopes attached to the token can be explicitly or implicitly consented to, based on your user / application / other policy.
- Include custom claims in the ID Token: The ID token issued by OpenID Connect can be set to include additional arbitrary claims, such as details of the authentication event (IP address, geolocation) and user attributes.
Identity provision based on a array of simple web services
How is this level of customisation achieved? By a server back-end that is not monolithic, but based on a array of nimble RESTful / JSON-RPC 2.0 web services, where each service caters for a specific, tightly defined task. The various tasks then put together make up the overall IdP process:
- A web API for decoding and encoding the OAuth 2.0 / OpenID Connect protocol requests and responses exchanged with relying parties (RP). This API is used for example by the UI page for the OIDC authorisation endpoint, to render the consent form and specify which claims / scopes the user should explicitly agree on and which will be implicitly set by the IdP, based on a policy.
- A web service for authenticating users, such as Nimbus AuthService that handles MS-AD / LDAP based authentication. Its web API is addressed by the UI pages that direct the login flow.
- A web service for tracking the user sessions, such as NimbusSSO. It handles session creation, update, expiration and removal events. Its web API can be scripted to monitor which users are currently online and their associated browsers / devices as well.
- An OAuth 2.0 authorisation store, which keeps track of all issued authorisation codes, access and refresh tokens. It provides a RESTful API to allow for token revocation and monitoring token usage by applications.
- An OAuth 2.0 client registry, which contains the details and credentials / RSA / EC keys of all applications, manually or dynamically registered.
- A user store, based on a directory, accessed either directly via LDAPv3 or via Json2Ldap.
Example: Extending OAuth 2.0 authorisations with additional scope values
The following example illustrates how an identity provider may add additional scope values to a user’s authorisation (represented by the OAuth 2.0 access token, typically of type Bear). Apart from providing single sign-on based on OpenID Connect, the IdP server may also be used as a generic OAuth 2.0 server, to grant fine-grained access to the application or access to third-party services and applications.
- A user from the accounting department who logs in with OpenID Connect to the payroll application may be granted access to specific payment APIs.
- A user from the IT support department who logs in with OpenID Connect to an admin dashboard app may be granted access to specific server management APIs.
- A user from the legal department who logs in with OpenID Connect to a documentation system may be granted access to specific confidential documents.
In the context of OpenID Connect the access token is used to give the application access to the user’s profile details at the UserInfo endpoint. The scope of the access token can however be extended to grant access to additional protected resources, by including values that are recognised by these resources.
OAuth 2.0 scope for pure OpenID use only:
openid profile email
OAuth 2.0 scope with additional values recognised by other applications:
openid profile email payroll:disburse payroll:settle
The access scope that is granted to a particular user is determined during the OAuth 2.0 / OpenID Connect authorisation step. The scope to grant can be determined by explicit consent and / or by looking up the user’s and the client application’s attributes (e.g. user membership of an LDAP group, application trust level).
The additional scope values can be determined by calling an arbitrary script or executable code, which when completed should return a JSON array with the granted scope values. For example:
["openid", "profile", "email", "payroll:disburse", "payroll:settle"]
The scope is then used to compose the final OAuth 2.0 / OpenID Connect authorisation, which is passed to the OIDC server as a JSON object via a RESTful HTTP POST:
POST /authorize/67ee5264-26ff-45cd-a876-5de22fbb99b1 HTTP/1.1
Host: oidc.wonderland.net
Content-Type: application/json
{
"sub" : "alice@wonderland.net",
"ACR" : ["3"],
"authTime" : 2147483647,
"scope" : ["openid", "profile", "email",
"payroll:disburse", "payroll:settle"],
"userInfo" : ["sub", "name", "given_name", "family_name",
"profile", "email", "email_verified", "locale"]
}
Upon received the authorisation, the OIDC server generates the required authorisation code (if we have a code flow) and then a matching access / refresh token pair for the authorisation.
The application can validate the access token and get its matching authorisation by making a RESTful query to the OIDC server. We also consider adding support for access tokens which include the authorisation in a JWS-signed / JWE-encrypted form, to save the need for doing lookup over the network.
The following presentation slides also give a nice overview of how the OpenID Connect IdP solution is built and how its various web service components interact with each other:
Nimbus OIDC server presentation


