A token services is responsible to manage tokens in the client.

interface TokenService {
    findDirectAvailableTokenFor(
        target: string | URL,
    ): undefined | TokenLookupResult;
    findTokenFor(
        target: string | URL,
        options?: AbortOptions,
    ): Promise<undefined | TokenLookupResult>;
}

Methods

  • Finds already available token information for a given url. This function uses already stored information to lookup the token. Token information is only available if 'findTokenFor' method was invoked.

    Parameters

    • target: string | URL

      url for which a token should be looked up.

    Returns undefined | TokenLookupResult

  • Finds a token for a given url. The client should respect the transport metadata information. A token lookup result may be undefined, which means that no token is found.

    Parameters

    • target: string | URL

      url for which a token should be looked up.

    • Optionaloptions: AbortOptions

      transports an abort signal (optional)

    Returns Promise<undefined | TokenLookupResult>