Options
All
  • Public
  • Public/Protected
  • All
Menu

A lightweight OAuth2Client helper.

Hierarchy

  • OAuth2Client

Index

Methods

Static applicationHasImplicitGrant

  • applicationHasImplicitGrant(): boolean
  • Determines whether or not a token has been supplied using an implicit grant. In other words, whether or not there is an access_token parameter in the fragment (hash) of the document URL.

    Returns boolean

    whether or not an access_token is present in the fragment (hash) of the document URL.

Static applicationHasImplicitGrantError

  • applicationHasImplicitGrantError(): boolean
  • Determines whether or not an error has been supplied using an implicit grant. In other words, whether or not there is an error parameter in the fragment (hash) of the document URL.

    Returns boolean

    whether or not an error is present in the fragment (hash) of the document URL.

Static getErrorFromImplicitGrant

  • Gets the error parameter from the URL fragement indicating there was a problem with the login.

    Returns OAuth2Error

Static getTokenFromImplicitGrant

  • Gets token details from the URL, that have been specified in the OAuth2 implicit grant form. The parameters should be in the URL fragement, with names: access_token, username, and expires_in.

    Returns TokenResult

Static redirectToLogOnPage

  • redirectToLogOnPage(logonUrl: string, clientId: string): void
  • Redirects to the logon page, using the implicit grant style that is recommended for HTML/JavaScript web applications.

    Parameters

    • logonUrl: string

      The URL of the OAuth2 logon page.

    • clientId: string

      The client ID to use for logging in. That should represent this application.

    Returns void

Static removeImplicitGrantParamsAndUpdateUrlHash

  • removeImplicitGrantParamsAndUpdateUrlHash(): void
  • Removes all implicit grant parameters from the URL and updates the URL hash in the browser so that it doesn't contain those parameters.

    Returns void