跳到主要内容

IamContextValue

Axis Vertex JavaScript SDK: react


Axis Vertex JavaScript SDK: react / IamContextValue

Interface: IamContextValue

Properties​

client​

client: AuthClient

Underlying OAuthClient instance (advanced usage)


getAccessToken​

getAccessToken: () => string | null

Get current access token (for API calls)

Returns​

string | null


getAppContinuation​

getAppContinuation: () => Promise<AppContinuation>

Resolve app-owned continuation values and configured client-level logout redirect

Returns​

Promise<AppContinuation>


getLogoutUrl​

getLogoutUrl: (options?) => Promise<string | null>

Build a valid IAM RP-Initiated Logout URL, or null when it cannot be started safely

Parameters​

options?​

LogoutUrlOptions

Returns​

Promise<string | null>


handleCallback​

handleCallback: (code, state) => Promise<void>

Handle OAuth callback (exchange code for tokens)

Parameters​

code​

string

state​

string

Returns​

Promise<void>


handleRedirectCallback​

handleRedirectCallback: (options?) => Promise<RedirectCallbackResult>

Handle and scrub the current OAuth redirect callback URL

Parameters​

options?​

RedirectCallbackOptions

Returns​

Promise<RedirectCallbackResult>


initializationError​

initializationError: Error | null

Initialization failure from discovery or startup permission refresh.


isAuthenticated​

isAuthenticated: boolean

Whether user is authenticated


isLoaded​

isLoaded: boolean

Whether the SDK has finished initializing


login​

login: (options?) => Promise<void>

Redirect to login page (Authorization Code + PKCE flow)

Parameters​

options?​
locale?​

string

Returns​

Promise<void>


logout​

logout: (options?) => Promise<void>

Logout and optionally redirect to end session endpoint

Parameters​

options?​

LogoutOptions

Returns​

Promise<void>


permissionFetchError​

permissionFetchError: Error | null

Most recent permissions fetch error. Permissions remain fail-closed on error.


refreshToken​

refreshToken: () => Promise<TokenSet>

Refresh and atomically apply tokens and authoritative authorization.

Returns​

Promise<TokenSet>


sessionView​

sessionView: { error: Error | null; expiresAt: number | null; status: "error" | "anonymous" | "loading" | "ready" | "expired"; } | { error: Error | null; expiresAt: number | null; status: "error" | "anonymous" | "loading" | "ready" | "expired"; }


tokenRefreshError​

tokenRefreshError: IamTokenRefreshError | null

Safe failure metadata for automatic or manual refresh.


user​

user: IamUser | null

Current authenticated user (null if not logged in)