Options
All
  • Public
  • Public/Protected
  • All
Menu

Adapts HTTP authentication server to common objects like ServerEndpoint and Request.

It supports creating login, renew and logout requests based on supported protocol (OAuth, OpenID, custom JWT authentication ...).

It also supports setting the access token on any Request, reading Tokens from Response, and checking if Tokens.access or Tokens.refresh have expired from Response.

Implementation of this interface can be given to Auth constructor.

Type parameters

Hierarchy

  • ServerAdapter

Implemented by

Index

Methods

accessTokenHasExpired

  • Check if access token has expired from Response.

    Parameters

    • request: Request

      initial request that leads to the received response

    • response: Response

      received response

    Returns boolean

asLoginRequest

asLogoutRequest

asRenewRequest

getResponseTokens

refreshTokenHasExpired

  • Check if refresh token has expired from Response.

    Parameters

    • request: Request

      initial request that leads to the received response

    • response: Response

      received response

    Returns boolean

setAccessToken

  • setAccessToken(request: Request, accessToken: string | undefined): void
  • Apply the access token to a Request.

    It should add Authorization header.

    Parameters

    • request: Request

      request to configure

    • accessToken: string | undefined

      access Token.value to apply.

    Returns void

Legend

  • Function
  • Function with type parameter
  • Type alias
  • Interface
  • Interface with type parameter
  • Method
  • Class
  • Class with type parameter

Generated using TypeDoc