Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • JAMaltaIssuer

Index

Constructors

  • new JAMaltaIssuer(clientId: string, clientSecret: string, redirectUris: string[], responseTypes: string[], scopes: string[], options?: IssuerOptions): JAMaltaIssuer
  • Constructs the Issuer Module

    Parameters

    • clientId: string

      Client ID

    • clientSecret: string

      Client Secret

    • redirectUris: string[]

      The redirect uris

    • responseTypes: string[]

      Response types such as code, id_token, etc

    • scopes: string[]

      Required scopes. The array is then converted into a string seperated by spaces

    • Optional options: IssuerOptions

      Optional options for client. @seeIssuerOptions.

    Returns JAMaltaIssuer

Properties

_client: BaseClient
_issuer: Issuer<BaseClient>
cacheTTL: number
clientId: string
clientSecret: string
codeChallenge: string
codeVerifier: string
issuerUrl: string
redirectUris: string[]
responseTypes: string[]
scope: string
tokenStore: Map<string, TokenSet>
userCache: Map<string, UserCache>

Accessors

  • get authorisationUrl(): Promise<string>
  • Get the authorisation url based on the code challenge

    Returns Promise<string>

  • get client(): Promise<BaseClient>
  • Get the client which will handle all the coming requests

    Returns Promise<BaseClient>

  • get issuer(): Promise<Issuer<BaseClient>>
  • Auto-discover the issuer. Assumes OIDC Standards are met

    Returns Promise<Issuer<BaseClient>>

  • set storeToken(token: TokenSet): void
  • Store the token from Provider and the TokenSet information

    Parameters

    • token: TokenSet

    Returns void

Methods

  • getLogoutUrl(code: string): Promise<string>
  • Get the logout url for the client

    Parameters

    • code: string

    Returns Promise<string>

  • getToken(token: string): Promise<TokenSet>
  • Gets the token set based on the token given by the user

    At this point, if undefined is returned, get the authorisation url @see authorisationUrl and redirect the user back to the login page.

    Parameters

    • token: string

    Returns Promise<TokenSet>

  • getUserInfo(token: string | TokenSet): Promise<UserInfo>
  • Get the code from the token and makes a request to get the user information

    Parameters

    • token: string | TokenSet

    Returns Promise<UserInfo>

  • removeFromCache(token: string | TokenSet): void
  • Remove a token, and it's related user information from the cache.

    Parameters

    • token: string | TokenSet

      The token from the request

    Returns void

  • setUserInfoToCache(userCache: UserCache, code: string): void
  • verifyToken(req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>, uri?: number): Promise<TokenSet>
  • Verify the token received from the callback

    Parameters

    • req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>

      The request from express

    • Optional uri: number

      In the case that multiple redirectUris are passed, it will either default to the first uri or the given, second uri @see redirectUris

    Returns Promise<TokenSet>

Generated using TypeDoc