Signet
GitHubCommunityWhat's NewChatBot
  • 🌐eSignet
  • 🔍Overview
    • ✨Features
      • Signup Portal
    • âš–ī¸Principles
    • 📏Standards & Security
    • 📜License
  • đŸ’ģDevelop
    • đŸĻžTechnology
      • đŸ“ĻTechnology Stack
      • âš™ī¸Components - eSignet
      • đŸ¤ŗComponents - Signup Portal
      • 📲API
    • âš™ī¸Configure eSignet
      • ACR
      • Claims
      • .well-known
        • jwks.json
        • oauth-configuration
        • openid-configuration
  • 🎮Test
    • đŸ•šī¸Try It Out
      • Using Mock Data
      • Register Yourself
      • Integrate with eSignet
    • 👨‍đŸ’ģEnd User Guide
      • Health Portal
        • Login with Biometrics
        • Login with Password
        • Login with OTP
        • Login with QR code (Inji)
        • Knowledge Based Identification
        • Signup and Login with OTP for Verified Claims
    • 🧩Integration Guides - eSignet
      • Authenticator Plugin
      • Key Binder Plugin
      • Audit Plugin
      • Digital Wallet
        • Credential Holder
        • Wallet Authenticator
      • Relying Party
    • 🔐Integration Guide - Signup Portal
      • Identity Verifier Plugin
      • Profile Registry Plugin
      • Integration with eSignet portal
  • đŸ› ī¸Deploy
    • â›´ī¸Deployment Architecture
      • On-Prem Installation Guidelines
    • ⚓Local Deployment
      • Mock Identity System
      • Mock Relying Party
  • 🔌Interoperability
    • MOSIP
    • Inji
    • OpenCRVS
  • 🚀Roadmap and Releases
    • đŸ›Ŗī¸Roadmap
      • Roadmap 2025
      • Roadmap 2024
    • 📖Releases
      • v1.5.1
        • Test Report
      • v1.5.0
        • Test Report
      • v1.4.2
      • v1.4.1
        • Test Report
      • v1.4.0
        • Test Report
      • v1.3.0
        • Test Report
      • v1.2.0
        • Test Report
      • v1.1.0
        • Test Report
      • v1.0.0
        • Test Report
      • v0.9.0
        • Test Report
  • 🤝Community
    • Code Contribution
    • Code of Conduct
  • 📌General
    • 📚Resources
    • ❓FAQs
    • 💡Glossary
Powered by GitBook

Copyright Š 2021 MOSIP. This work is licensed under a Creative Commons Attribution (CC-BY-4.0) International License unless otherwise noted.

On this page
  • Who should implement the Authenticator plugin interface?
  • How to implement this plugin?

Was this helpful?

Edit on GitHub
Export as PDF
  1. Test
  2. Integration Guides - eSignet

Authenticator Plugin

Last updated 4 months ago

Was this helpful?

The Authenticator plugin is the main interface for eSignet, which provides methods to authenticate the end-user with control of the supported authentication factors.

The two main functionalities of the authenticator interface, KYC Auth and KYC Exchange, are depicted in the below diagram

Below is the eSignet authenticator interface:

public interface Authenticator {

    /**
     * Delegate request to authenticate the user, and get KYC token
     * @param relyingPartyId relying Party (RP) ID. This ID will be provided during partner self registration process
     * @param clientId OIDC client Id. Auto generated while creating OIDC client in PMS
     * @param kycAuthDto
     * @return KYC Token and Partner specific User Token (PSUT)
     * @throws KycAuthException
     */
    @Deprecated
    KycAuthResult doKycAuth(String relyingPartyId, String clientId, KycAuthDto kycAuthDto)
            throws KycAuthException;

    /**
     * Delegate request to exchange KYC token with encrypted user data
     * @param relyingPartyId relying Party (RP) ID. This ID will be provided during partner self registration process
     * @param clientId OIDC client Id. Auto generated while creating OIDC client in PMS
     * @param kycExchangeDto
     * @return signed and encrypted kyc data.
     * @throws KycExchangeException
     */
    KycExchangeResult doKycExchange(String relyingPartyId, String clientId, KycExchangeDto kycExchangeDto)
            throws KycExchangeException;

    /**
     * Delegate request to send out OTP to provided individual Id on the configured channel
     * @param relyingPartyId relying Party (RP) ID. This ID will be provided during partner self registration process
     * @param clientId OIDC client Id. Auto generated while creating OIDC client in PMS
     * @param sendOtpDto
     * @return status of send otp response.
     * @throws SendOtpException
     */
    SendOtpResult sendOtp(String relyingPartyId, String clientId, SendOtpDto sendOtpDto)
            throws SendOtpException;

    /**
     * supported OTP channel to validate in Send-otp request.
     * @return true if supported, otherwise false
     */
    boolean isSupportedOtpChannel(String channel);

    /**
     * Get list of KYC signing certificate and its details.
     * @return list
     */
    List<KycSigningCertificateData> getAllKycSigningCertificates() throws KycSigningCertificateException;

    /**
     * Authenticate and return individual's claims metadata if requested
     * @param relyingPartyId
     * @param clientId
     * @param claimsMetadataRequired
     * @param kycAuthDto
     * @return
     * @throws KycAuthException
     */
    default KycAuthResult doKycAuth(String relyingPartyId, String clientId, boolean claimsMetadataRequired, KycAuthDto kycAuthDto)
            throws KycAuthException {
        return doKycAuth(relyingPartyId, clientId, kycAuthDto);
    }

    /**
     * Providioned to return verified userinfo based on the provided verification requirement
     * @param relyingPartyId
     * @param clientId
     * @param kycExchangeDto
     * @return
     * @throws KycExchangeException
     */
    default KycExchangeResult doVerifiedKycExchange(String relyingPartyId, String clientId, VerifiedKycExchangeDto kycExchangeDto)
            throws KycExchangeException {
        return doKycExchange(relyingPartyId, clientId, kycExchangeDto);
    }
}

Who should implement the Authenticator plugin interface?

An Identity system can be as simple as a table in a database or an Excel file storing user identity data or it can be a complex Identity System.

How to implement this plugin?

The Authenticator implementation class must be annotated with ConditionalOnProperty with mosip.esignet.integration.authenticator property.

@ConditionalOnProperty(value = "mosip.esignet.integration.authenticator", havingValue = "mock-authentication-service")
@Component
@Slf4j
public class MockAuthenticationService implements Authenticator {
    //Implement authenticator methods
}

For example, if OTP is one of the supported authentication factors in your identity system, the authenticator interface provides a method to,

  • Define the supported OTP channels,

  • Implement the send-OTP functionality

If the identity system does not support OTP based authentication then you could throw an exception with the appropriate error code.

    SendOtpResult sendOtp(String relyingPartyId, String clientId, SendOtpDto sendOtpDto) {
        throw new SendOtpException("not_supported");
    }

    boolean isSupportedOtpChannel(String channel) {
        return false;
    }

And also configure eSignet to expose only supported auth factors in the well-known endpoint.

Note: For the latest version of the interface please check our code base -

The authenticator plugin is implemented by , which wishes to integrate with eSignet to leverage the digital usage of identities.

Below is an example of how our has implemented the eSignet Authenticator plugin.

🎮
🧩
Authenticator.java
Mock Identity System
Identity Systems