Vulos Documentation
  • Identity
    • Welcome to the Vulos Identity Documentation!
    • Quick Start
    • Organizations
    • Scopes and Claims
  • Reference
    • Identity JavaScript SDK
      • The Base Package
        • KYC
          • KycStatus
          • KycInstance
          • KycDetails
          • KycApi
        • Profile
          • UserReference
          • ProfileApi
        • Cache
        • Authentication
          • Application
          • BaseAuth
          • User
          • UserInfo
          • BaseApi
        • Organizations
          • Organization
          • OrganizationMembership
            • OrganizationMembershipWithMetadata
          • OrganizationRole
          • OrganizationApi
      • The Backend Auth Package
        • CodeVerifier
        • BackendAuth
      • The Frontend Auth Package
        • IFrameRefresh
        • StateVerifier
        • FrontendAuth
    • Organization API
      • Organizations
      • Memberships
        • Roles
    • Profile API
    • KYC API
Powered by GitBook
On this page
  • Members
  • client : any | null
  • Interfaces
  • OpenIDTokenSet
  • Methods
  • async setRefreshTokenCallback(fn)
  1. Reference
  2. Identity JavaScript SDK
  3. The Frontend Auth Package

FrontendAuth

PreviousStateVerifierNextOrganization API

Last updated 3 years ago

This class implements .

Members

client : any | null

An implementation specific OpenID connect client.

Interfaces

OpenIDTokenSet

interface OpenIDTokenSet {
    access_token: string,
    expires_at: number,
    token_type?: 'Bearer',
    id_token?: string,
    refresh_token?: string
}

Methods

async setRefreshTokenCallback(fn)

This function sets a refresh callback implementation for this object.

The fn argument must be a function that takes a refresh token (string) as an argument and returns a promise that contains an object that implements the OpenIDTokenSet interface.

import { IFrameRefresh } from '@vulos/identity-browser-sdk';

await auth.setRefreshTokenCallback(async function(refreshToken) {
    console.log(this) // this is the auth object
    if (refreshToken) {
        // refresh using a refresh token
    } else {
        throw new Error('Not supported')
    }
})

This class overrides previously defined methods from .

An iframe-based implementation is provided as .

BaseAuth
BaseAuth
IFrameRefresh