Sidebar On this page

What is Identity Provider?

An Identity Provider (IdP) is a system that creates, maintains, and manages identity information for users and provides authentication services to relying party applications. insureMO CAS can act as a standard Identity Provider, enabling third-party applications to authenticate users and obtain tokens via industry-standard protocols.

OIDC Provider

This section is intended for technical teams integrating third-party applications with the insureMO platform for identity authentication. The insureMO CAS service acts as a standard OpenID Connect Provider (OP), enabling third-party applications to authenticate users and obtain tokens via the standard OIDC protocol.

Overview and Standards Compliance

insureMO CAS (Central Authentication Service) implements the standard OpenID Connect Provider (OP) role, allowing third-party applications (Relying Party / Service Provider) to authenticate users through the OIDC protocol.

Standard/SpecificationCompliance StatusDescription
OpenID Connect Core 1.0CompliantSupports Discovery, Authorization Code Flow, Token endpoint, UserInfo
OAuth 2.0 (RFC 6749)CompliantSupports authorization_code and client_credentials grant types
PKCE (RFC 7636)CompliantSupports S256 method; mandatory for Public Clients
RFC 8414 (Authorization Server Metadata)Compliant/.well-known/oauth-authorization-server
RFC 9728 (Protected Resource Metadata)Compliant/.well-known/oauth-protected-resource
JWT (RFC 7519)CompliantID Token signed with RS256

Core Architecture:

Third-Party Application (Relying Party)
|
+-- 1. Discover: GET /.well-known/oauth-authorization-server
|
+-- 2. Authorize: GET /cas/oidc/authorize?client_id=xxx&redirect_uri=yyy&response_type=code
| |
| +-- User authenticates on the CAS login page
| |
| +-- 302 Redirect back: redirect_uri?code=AUTH_CODE&state=STATE
|
+-- 3. Exchange Token: POST /cas/oidc/token
| | Body: grant_type=authorization_code&code=AUTH_CODE&client_id=xxx&client_secret=yyy
| |
| +-- Response: { access_token, id_token, token_type, expires_in }
|
+-- 4. Get User Info: GET /cas/oidc/userinfo
| Header: Authorization: Bearer {access_token}
| +-- Response: { sub, name, email, ... }
|
+-- 5. Validate Token: Call Validated Token API

Endpoint Summary

All OIDC Provider endpoints are accessed via the gateway URL.

EndpointPathMethodDescription
Authorization Server Metadata (RFC 8414)/.well-known/oauth-authorization-serverGETDiscovery endpoint (returns all OIDC/OAuth 2.0 configuration)
Protected Resource Metadata (RFC 9728)/.well-known/oauth-protected-resourceGETProtected resource discovery
OIDC Discovery (classic path)/cas/oidc/.well-known/openid-configurationGETStandard OIDC discovery document for libraries that resolve discovery under the path root
JSON Web Key Set/cas/oidc/.well-known/jwks.jsonGETPublic signing keys for JWT/ID Token signature verification
Token Validation/cas/validate-tokenGETValidates token and returns user information
Authorization/cas/oidc/authorizeGET / POSTAuthorization endpoint
Token/cas/oidc/tokenPOSTToken endpoint
UserInfo/cas/oidc/userinfoGET / POSTUser information endpoint
Logout/cas/oidc/logoutGETLogout endpoint

Important: Use the Discovery endpoint to automatically obtain the complete OIDC/OAuth 2.0 configuration.

Discovery Endpoint

External clients should use this endpoint to retrieve the complete OIDC Provider configuration:

GET {gateway_url}/.well-known/oauth-authorization-server

Response Example:

{
"issuer": "https://{gateway_url}/cas",
"authorization_endpoint": "https://{gateway_url}/cas/oidc/authorize",
"token_endpoint": "https://{gateway_url}/cas/oidc/token",
"jwks_uri": "https://{gateway_url}/cas/oidc/.well-known/jwks.json",
"userinfo_endpoint": "https://{gateway_url}/cas/oidc/userinfo",
"scopes_supported": ["openid", "profile", "email"],
"response_types_supported": ["code", "token", "id_token", "token id_token"],
"grant_types_supported": ["authorization_code", "client_credentials"],
"token_endpoint_auth_methods_supported": ["client_secret_basic", "private_key_jwt", "none"],
"code_challenge_methods_supported": ["S256"],
"subject_types_supported": ["public"],
"id_token_signing_alg_values_supported": ["RS256"],
"claims_supported": ["sub", "name", "nickname", "preferred_username", "email"]
}

The jwks_uri publishes the public signing keys (RS256), so clients can verify JWT/ID Token signatures locally. To validate a token server-side instead, call the Token Validation API (/cas/validate-token).

Client Application Registration and Configuration

OIDC client applications are configured by tenant administrators through the Portal management interface. Upon registration, you will receive a client_id and client_secret (if applicable).

Navigation: Log in to Portal -> SSO Config -> Applications -> Create an OIDC-type application.

ParameterJSON FieldTypeRequiredDescription
Client IDclient_idstringSystem-generatedUnique client identifier, auto-generated by the system
Client Secretclient_secretstringSystem-generatedClient secret; not available for Public Client (auth_method=none)
Sign-in Redirect URLsignin_redirect_urlstringRequired for authorization_codeOIDC authorization code callback URL
Sign-out Redirect URLsignout_redirect_urlstringNoOIDC logout callback URL
Grant Typegrant_typestringYesauthorization_code / client_credentials / password
Token Endpoint Auth Methodtoken_endpoint_auth_methodstringYesclient_secret_basic (default) / private_key_jwt / none (Public Client)
User Source IDuser_source_idstringNoDefault: "mo"
Default Userdefault_userstringRequired for client_credentialsMachine user identifier for M2M scenarios
Allowed Access Tenantsallowed_access_tenantsstringNoComma-separated list of tenant codes
Tenant Codetenant_codestringYesTenant to which the client belongs
Application Nameapp_namestringNoApplication name (for management identification)
Typetoken_endpoint_auth_methodclient_secretPKCEUse Case
Confidential Clientclient_secret_basicAvailableOptionalServer-side applications (Web backend)
Public ClientnoneNot availableMandatorySPA, mobile apps, CLI tools

Authorization Code Flow

The Authorization Code Flow is the most commonly used and secure OIDC authentication flow, suitable for applications with a server-side component.

Step 1: Initiate Authorization Request

The third-party application redirects the user’s browser to the CAS authorization endpoint:

GET {gateway_url}/cas/oidc/authorize
?client_id={client_id}
&redirect_uri={redirect_uri}
&response_type=code
&scope=openid+profile+email
&state={random_state}
ParameterRequiredDescription
client_idYesClient ID obtained during registration
redirect_uriYesMust match the signin_redirect_url configured during registration
response_typeYesFixed value: code
scopeYesRequested scopes; supports openid, profile, email
stateYesRandom string for CSRF protection; returned as-is in the callback

PKCE Parameters (Required for Public Client):

ParameterDescription
code_challengeS256 method: BASE64URL(SHA256(code_verifier))
code_challenge_methodFixed value: S256

Step 2: CAS displays the login page. The user enters their credentials to complete authentication.

Step 3: After successful authentication, CAS redirects the user’s browser back to the redirect_uri:

{redirect_uri}?code={authorization_code}&state={original_state}
  • authorization_code: One-time authorization code, valid for approximately 250 seconds
  • state: The state value passed in the original request, returned as-is

Step 4: Exchange Authorization Code for Tokens

POST {gateway_url}/cas/oidc/token
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code
&code={authorization_code}
&client_id={client_id}
&client_secret={client_secret}
&redirect_uri={redirect_uri}

Public Client (no client_secret) must include PKCE parameters:

&code_verifier={original_code_verifier}

Alternatively, use HTTP Basic Auth to pass client credentials:

Authorization: Basic {base64(client_id:client_secret)}

Response (HTTP 200):

{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 7200,
"id_token": "eyJhbGciOiJSUzI1NiIs..."
}

PKCE Support

CAS fully supports PKCE (Proof Key for Code Exchange, RFC 7636) to enhance the security of authorization codes, particularly for public clients that cannot securely store a client_secret.

Client TypePKCE RequiredDescription
Confidential Client (has client_secret)OptionalCan include PKCE for enhanced security
Public Client (no client_secret, auth_method=none)MandatoryMust use PKCE; otherwise the token request will be rejected
Private Key JWT ClientOptionalCan include PKCE for enhanced security
MethodDescription
S256Recommended: BASE64URL(SHA256(code_verifier))
plainSupported: code_verifier as-is; lower security

If code_challenge_method is not specified, S256 is used by default.

Client Credentials Flow

Suitable for direct service-to-service (M2M) calls without user involvement.

POST {gateway_url}/cas/oidc/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials
&client_id={client_id}
&client_secret={client_secret}

Prerequisites:

  • The client’s grant_type must include client_credentials
  • A default_user (machine user identifier) must be configured; this user will be the identity subject of the token

Response:

{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 7200,
"id_token": "eyJhbGciOiJSUzI1NiIs..."
}

Token Response

Success Response (HTTP 200):

FieldTypeDescription
access_tokenstringOpaque access token or JWT
token_typestringFixed value: "Bearer"
expires_inintegerToken validity period (seconds); default 7200 (2 hours), configurable per tenant
id_tokenstringOpenID Connect ID Token (JWT format, signed with RS256)

Error Response:

Error CodeDescription
invalid_grantAuthorization code is invalid, expired, or PKCE verification failed
invalid_requestMissing required parameters or incorrect client_id format
invalid_clientClient authentication failed
server_errorInternal server error; please retry later

Token Claims

ID Token Claims (JWT signed with RS256):

ClaimTypeDescriptionExample
substringSubject (unique user identifier)"2002554412" (user ID)
audstringAudience["{client_id}"]
expintegerExpiration timeUnix timestamp
namestringFull name"john.doe"
nicknamestringNickname"john.doe"
preferred_usernamestringPreferred username"john.doe"
emailstringEmail address"john.doe@insuremo.com"
userNamestringUsername (platform extension)"john.doe"
tenantstringTenant code (platform extension)"mo-fo"

JWT Header:

{
"alg": "RS256",
"kid": "key-id-from-kms",
"typ": "JWT"
}

kid (Key ID) identifies the signing key and supports key rotation scenarios.

Access Token Claims (JWT signed with RS256):

ClaimTypeDescription
substringUser ID (machine user ID for client_credentials flow)
expintegerExpiration time (Unix timestamp)
iatintegerIssued at time (Unix timestamp)
scopestringAuthorization scope; fixed value: "openid email profile"

Token Signing and Verification

PropertyValue
AlgorithmRS256 (RSA + SHA-256)
Key TypeRSA

The recommended method for token verification is the Validated Token API:

GET {gateway_url}/cas/validate-token
Authorization: Bearer {access_token}

This endpoint performs complete token verification (signature, expiration, etc.) on the CAS server side and returns user information. Third-party applications do not need to obtain public keys or verify JWT signatures themselves.

UserInfo Endpoint

GET {gateway_url}/cas/oidc/userinfo
Authorization: Bearer {access_token}

Response (HTTP 200):

{
"sub": "2002554412",
"name": "john.doe",
"nickname": "john.doe",
"preferred_username": "john.doe",
"email": "john.doe@insuremo.com"
}

Application Integration Guide

Standard Integration Process:

  1. Log in to insureMO Portal with a tenant administrator account, navigate to SSO Config -> Applications, and prepare the following:

    • Application name
    • Callback URL (redirect_uri)
    • Required grant type (authorization_code / client_credentials)
    • Client type (Confidential / Public)
    • Tenant code
  2. Obtain client credentials:

    • client_id — Unique client identifier
    • client_secret — Client secret (not available for Public Client)
  3. Configure your application:

    • Use the Discovery endpoint to automatically retrieve the CAS OIDC configuration
    • Configure the Token endpoint, Authorization endpoint, etc.
    • Use the Validated Token API for token verification
  4. Implement the OIDC authorization flow:

    • Confidential Client: Standard Authorization Code Flow
    • Public Client: Authorization Code Flow + PKCE
    • M2M scenario: Client Credentials Flow

Configuration with Common OIDC Libraries:

Most standard OIDC libraries support automatic configuration via the Discovery URL. Configure the library with an explicit Discovery URL — either of the two registered locations works:

  • RFC 8414 style (gateway root): https://{gateway_url}/.well-known/oauth-authorization-server
  • Classic OIDC path: https://{gateway_url}/cas/oidc/.well-known/openid-configuration

Then provide:

  • Client ID: Client ID obtained during registration
  • Client Secret: Client secret obtained during registration (not needed for Public Client)
  • Redirect URI: Callback URL configured during registration

The library will automatically retrieve authorization_endpoint, token_endpoint, jwks_uri, and other configurations from the Discovery document. Note that the issuer value in the document is https://{gateway_url}/cas; if your library derives the discovery location from the issuer, prefer entering the Discovery URL directly, because issuer-based auto-discovery resolves to a path that is not registered on the gateway.

Token Verification:

When verifying tokens issued by CAS, consuming applications can:

  1. Verify signatures locally via JWKS: GET {gateway_url}/cas/oidc/.well-known/jwks.json returns the public signing keys (RS256); the same URL is published as jwks_uri in the Discovery document.
  2. Call the Validated Token API: GET {gateway_url}/cas/validate-token with Authorization: Bearer {access_token}. CAS performs server-side verification and returns user information.
  3. Call the UserInfo endpoint (optional): GET {gateway_url}/cas/oidc/userinfo with Authorization: Bearer {access_token} to retrieve the latest user profile information.

Known Limitations

LimitationDescriptionPlan
ID Token missing iss claimThe issuer claim is not explicitly set in the current ID TokenCan be inferred from the issuer field in the Discovery response

SAML Provider

Besides OIDC, insureMO can also act as a SAML 2.0 Identity Provider for applications that only speak SAML.

Register a SAML application (Service Provider)

  1. Ask the application team for the SP metadata (XML file or URL). At minimum you need the Entity ID (sp_entity_id) and the Assertion Consumer Service URL (acs_url) from it.
  2. On the Applications page (SSO card → Setting → Applications), edit the application with idp_type: SAML, and provide:
    • sp_entity_id and acs_url — must match the SP metadata exactly;
    • relay_state (optional) — the default relay state passed to the application;
    • logout_url (optional) and check_user_url (optional);
    • the SP metadata XML pasted into the SP metadata editor (or the SP metadata URL).
  3. Choose the access scope: owner tenant only, all tenants, or specific tenants.

Give insureMO IdP information to the application

  • Provide the insureMO SAML IdP metadata URL of that application to the application team: https://<your-environment-domain>/cas/saml/idp/metadata/<app_id>, where <app_id> is the App ID of the application you registered on the Applications page. The IdP metadata (entity descriptor, signing certificate, endpoints) is generated per application, so each registered application has its own metadata URL.
  • Do not confuse the two SAML metadata URLs:
    • IdP metadata (this section, insureMO acting as Identity Provider): /cas/saml/idp/metadata/<app_id> — give it to the application team so their Service Provider can trust insureMO.
    • SP metadata (insureMO acting as Service Provider, external IdP logins; see the SSO Service guide): /cas/saml/metadata — that one is registered on the external identity provider’s side, together with the Reply URL /cas/saml/acs. The How to config SSO page generates these SP-side values.
  • The application registers the IdP metadata on its side; the application’s Entity ID (sp_entity_id) and Assertion Consumer Service URL (acs_url) must match the values entered in step 2.

FAQ

OIDC Integration

Q1: Does the insureMO OIDC implementation comply with OpenID Connect standards?

Yes. The CAS service implements the standard OIDC Provider role, supporting:

  • Standard Discovery endpoints (/.well-known/oauth-authorization-server per RFC 8414, and the classic /cas/oidc/.well-known/openid-configuration)
  • Standard Authorization Code Flow
  • Standard Token endpoint (/cas/oidc/token)
  • Standard UserInfo endpoint (/cas/oidc/userinfo)
  • Standard JWKS endpoint (/cas/oidc/.well-known/jwks.json)
  • Validated Token API (/cas/validate-token)
  • PKCE support (RFC 7636)

Third-party applications can use any standard OIDC library for integration.

Q2: Can applications verify tokens using only platform-provided endpoints and public keys?

Yes. Two options:

  1. Local signature verification: fetch the public signing keys from the JWKS endpoint GET /cas/oidc/.well-known/jwks.json (also published as jwks_uri in the Discovery document) and verify the RS256 signature on your side.
  2. Server-side verification (simpler): call the Validated Token API (GET /cas/validate-token) with the bearer token; CAS verifies the token and returns the user information, so applications do not need to manage keys.

Q3: How do I register a client application?

Log in to insureMO Portal with a tenant administrator account, navigate to SSO Config -> Applications, and complete the OIDC client registration. Upon completion, you will receive a client_id and client_secret (not available for Public Client).

Q4: What is the validity period of an Authorization Code?

The authorization code is valid for approximately 250 seconds (about 4 minutes). Call the Token endpoint to exchange the code promptly after obtaining it.

Q5: What is the validity period of an Access Token?

The default is 7200 seconds (2 hours), configurable per tenant. The actual validity period is returned in the expires_in field of the Token response.

Q6: Which Grant Types are supported?

Grant TypeDescription
authorization_codeAuthorization Code flow, suitable for Web applications with a backend
client_credentialsClient Credentials flow, suitable for M2M scenarios

Q7: What is the difference between the CAS exchange_code flow and the standard OIDC authorization code?

These are two completely independent mechanisms:

Standard OIDC Authorization CodeCAS Exchange Code
PurposeThird-party application OIDC integrationInternal platform identity propagation
Endpoints/cas/oidc/authorize + /cas/oidc/token/cas/exchange-code/get + /cas/exchange-code/consume
ProtocolStandard OIDCinsureMO proprietary protocol

For third-party application integration, use the standard OIDC Authorization Code flow.

Q8: What are the requirements for the PKCE code_verifier?

  • Length: 43-128 characters (45+ recommended)
  • Character set: [A-Za-z0-9-._~]
  • Must be stored securely on the client side (e.g., in sessionStorage) and must not be exposed to the server

Q9: How should I handle Token expiration?

When an Access Token expires, the application should re-initiate the OIDC authorization flow to obtain a new token. It is recommended to initiate re-authentication before the expires_in period elapses, with a buffer for safety.


Feedback
Was this page helpful?
|
Provide feedback