Options
All
  • Public
  • Public/Protected
  • All
Menu

@dfinity/authentication

Index

Type aliases

AccessToken: string & { _BRAND: "access_token" }

A parsed access token.

Functions

  • Create a URL that can be used to redirect the browser to request authentication (e.g. using the authentication provider). Will throw if some options are invalid.

    Parameters

    • options: CreateUrlOptions

      An option with all options for the authentication request.

    Returns URL

  • createDelegationChainFromAccessToken(accessToken: AccessToken): DelegationChain
  • Create a DelegationChain from an AccessToken extracted from a redirect URL.

    Parameters

    • accessToken: AccessToken

      The access token extracted from a redirect URL.

    Returns DelegationChain

  • getAccessTokenFromURL(url: string | URL): AccessToken | null
  • Analyze a URL and try to extract an AccessToken from it.

    Parameters

    • url: string | URL

      The URL to look into.

    Returns AccessToken | null

  • Returns an AccessToken from the Window object. This cannot be used in Node, instead use the getAccessTokenFromURL function.

    An access token is needed to create a DelegationChain object.

    Returns AccessToken | null

  • Analyze a DelegationChain and validate that it's valid, ie. not expired and apply to the scope.

    Parameters

    • chain: DelegationChain

      The chain to validate.

    • Optional checks: DelegationValidChecks

      Various checks to validate on the chain.

    Returns boolean

Generated using TypeDoc