Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Auth

AeroGear Auth SDK. Wrapper class for {Keycloak.KeycloakInstance}

Hierarchy

  • Auth

Index

Constructors

constructor

  • new Auth(config: ConfigurationService): Auth
  • Parameters

    • config: ConfigurationService

    Returns Auth

Properties

Static TYPE

TYPE: string = "keycloak"

Methods

extract

  • extract(): KeycloakInstance
  • Get access to wrapped Keycloak object

    Returns KeycloakInstance

getAuthContextProvider

  • getAuthContextProvider(tokenUpdateTime?: number): (Anonymous function)
  • Provides an Authorization Context which contains a token and a prebuilt header

    Parameters

    • Default value tokenUpdateTime: number = 10

      time (in seconds) to refresh the token

    Returns (Anonymous function)

getConfig

  • getConfig(): string[]
  • Return the config used for the auth service

    Returns string[]

getRealmRoles

  • getRealmRoles(): string[]
  • Return the users realm level roles

    Returns string[]

hasConfig

  • hasConfig(): boolean
  • Return true if config is present

    Returns boolean

hasRealmRole

  • hasRealmRole(role: string): boolean
  • Check it the user has a specified realm role

    Parameters

    • role: string

    Returns boolean

init

  • init(initOptions: KeycloakInitOptions): Promise<boolean>
  • Called to initialize the adapter.

    Parameters

    • initOptions: KeycloakInitOptions

      Initialization options.

    Returns Promise<boolean>

    A promise to set functions to be invoked on success or error.

isAuthenticated

  • isAuthenticated(): boolean

loadUserProfile

  • loadUserProfile(): Promise<KeycloakProfile>
  • Loads the user's profile.

    Returns Promise<KeycloakProfile>

    A promise to set functions to be invoked on success or error.

login

  • login(): Promise<void>
  • Redirects to login form.

    Returns Promise<void>

logout

  • logout(): Promise<void>
  • Redirects to logout.

    Returns Promise<void>

Generated using TypeDoc