OIDCClient

Constructors

Properties

attributes: string[]

The list of attributes to request from the IDP

callbackURL: string

The callback URL after the authentication process (defaults to clientID+"/callback")

clientID: string

The client ID for the OIDC client

spidLevel: 1 | 2 | 3

The SPID level to request (1, 2 or 3, default is 2)

trustMarks: TrustMark[]

The list of trustmarks provided by the RP

Methods

  • Get the login URL for the given IDP, to which the user will be redirected to, in order to start the authentication process

    Parameters

    • idp: string

      The IDP ID for which to get the login URL

    Returns Promise<{
        error?: string;
        ok: boolean;
        url?: string;
    }>

    The response object

  • Handle a callback from the IDP after the authentication process has been completed

    Parameters

    • __namedParameters: {
          code: string;
          iss: string;
          state: string;
      }
      • code: string
      • iss: string
      • state: string

    Returns Promise<{
        error?: string;
        ok: boolean;
        payload?: Record<string, string>;
    }>

    The requested user information

  • Get the OIDC Federation endpoint for the IDP

    Parameters

    • federation_entity: {
          contacts: string[];
          organization_name: string;
      }

      Object that will be included in the federation_entity field of the federation

      • contacts: string[]
      • organization_name: string
    • opts: {
          json: boolean;
      } = ...

      Additional options

      • json: boolean

    Returns Promise<string | object>

    The requested entity statement

  • Get the information about a provider, automatically validating it if necessary, otherwise returning the cached version

    Parameters

    • idp: string

      Identity provider ID (as defined in the configuration)

    Returns Promise<ParsedIDP>

    The provider object

    If it's not possibile to find the provider, its configuration or validating it