githubEdit

Development and Integration with eSignet

This guide provides a step-by-step approach for developers who want to integrate their application as a Relying Party (RP) with eSignet.

Prerequisites

Before integrating your Relying Party application with eSignet, ensure the following are in place:

Requirement
Description

Client registered with eSignet

RP must be onboarded and issued a client_id. client_secret is not applicable.

eSignet well-known endpoint access

/.well-known/jwks.json

/.well-known/openid-configuration

Client Authentication Method

Only private_key_jwt is supported for token endpoint client authentication. Access to RSA/EC Private Key used by RP to sign the JWT during token request. Note: Should be securely stored and rotated periodically.

Registered Redirect URI

Must be pre-configured with eSignet(during onboarding ). It may be:

  • A frontend page

  • A mobile app deeplink / custom scheme

  • Or even a backend endpoint

Scopes/Claims required by RP

openid is mandatory. Optional scopes → profile, email, phone, or custom scopes if supported.

Note: Check the /.well-known/openid-configuration for supported scopes and claims.

Choose libraries for JWT Creation, Signing & OIDC Integration

Since private_key_jwt authentication requires the RP to generate a signed JWT for token requests, we recommend using well-supported cryptographic and OIDC client libraries. Developers may choose one based on their language/platform.

Reference: https://openid.net/developers/certified-openid-connect-implementations/arrow-up-right

Always fetch the authorize, PAR, token, userinfo endpoint URL dynamically from .well-known/openid-configuration. This ensures your integration remains compatible even if environments or endpoints change.

🛠️ Step-by-Step implementation:

Step 1: Redirect user to eSignet Authorization Endpoint

Add a Sign-in with eSignet button to your login page that links to the authorize URL. A lightweight JavaScript plugin is available from eSignet to render this button automatically. By default, the plugin can be loaded from:

https://<eSignet-domain>/plugins/sign-in-button-plugin.js

The button may follow specific branding guidelines such as name, logo usage, color scheme, and size. These are typically defined by the Identity Provider. eSignet provides a UI Storybookarrow-up-right that demonstrates recommended styles and customization options for relying party implementations: Additionally, sign-in-button-plugin.js provides PAR and DPoP support. Refer storybook to know more details on how to configure and use the par_callback and dpop_callback parameter.

eSignet Authorization Endpoint Specification

PAR Support in Authorization Request

eSignet supports Pushed Authorization Requests (PAR) as per OAuth 2.0 standards. Using PAR, the RP first submits authorization request parameters directly to eSignet through a secure back-channel PAR endpoint, then receives a request_uri which is used in the authorize URL.

eSignet PAR Endpoint Specification

circle-check

eSignet handles:

🔐 Authentication with the chosen authentication method. Eg: OTP / Biometrics / Wallet 🔐 Consent screen (only if claims are shared)

Successful authentication

If authentication succeeds, the user is redirected to the redirect_uri specified in the authorization request, along with an authorization code returned in the code query parameter.

Failed authentication

If authentication fails, the user is redirected to the same redirect_uri, but with an error code returned in the error query parameter. It is the RP’s responsibility to handle the error appropriately.

Step 3: Exchange Code for Tokens

Exchange authorization code for an Access token using the token endpoint. It is always suggested to use the token endpoint URL published in the .well-known/openid-configuration. This ensures your integration remains compatible even if environments or endpoints change.

Refer the below for token endpoint details:

eSignet Token Endpoint Specification

Step 4: Verify & Parse the Access & ID Token

Access token generated by eSignet follow [RFC9068] JSON Web Token (JWT) Profile for OAuth 2.0 Access Tokens.

  • Validate JWT signature using public key published on eSignet /.well-known/jwks.json

  • Validate aud, iss, exp, iat in both the tokens.

  • Additionally validate auth_time, nonce, acr, at_hash in the ID token.

💡Key Notes:

  • eSignet does not support user claims in ID token.

  • The sub claim in ID and access token is a pairwise pseudonymous identifier.

Avoid storing ID Tokens or Access Tokens in browser localStorage or sessionStorage. If an attacker gains access to the browser context, they can extract the tokens and impersonate the user.

Instead, it is recommended to perform the token exchange and validation on the RP backend and maintain a secure server-side session. The user’s browser should only store a short-lived, HTTP-only, SameSite cookie that maps to this session for stronger protection model.

Step 5: Get Consented User Claims Using Access Token

If the Relying Party (RP) needs user attributes (e.g., eKYC data), the developer must implement a call to the userinfoendpoint using the Access Token obtained during token exchange. Always fetch the endpoint URL dynamically from .well-known/openid-configuration

This ensures your integration remains compatible even if environments or endpoints change.

The userinfo response is returned as a signed JWT (JWS) by default. The RP must validate the JWT signature using the public keys from /.well-known/jwks.json

If required, the RP can be configured to request an encrypted (JWE) userinfo response for additional security.

💡Key Notes:

  • The sub claim in the userinfo JWT will match the sub present in both the Access Token and ID Token, ensuring user identity continuity.

  • Use the claims_locales parameter in the authorize request if user attributes need to be returned in a specific language. (This is supported only when the identity system maintains multilingual claims.)

Refer the below for userinfo endpoint details:

eSignet Userinfo Endpoint Specification

📄 Sample userinfo JWT payload:

📄 Sample userinfo JWT payload (with claims in 2 languages):

Last updated

Was this helpful?