Skip to content

Commit

Permalink
feat: expose introspect, interact methods on idx namespace
Browse files Browse the repository at this point in the history
OKTA-418222
<<<Jenkins Check-In of Tested SHA: f931fd1 for [email protected]>>>
Artifact: okta-auth-js
Files changed count: 4
PR Link: "#894"
  • Loading branch information
aarongranick-okta authored and eng-prod-CI-bot-okta committed Aug 9, 2021
1 parent a4bb17a commit 5c304f8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/OktaAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ import { AuthStateManager } from './AuthStateManager';
import StorageManager from './StorageManager';
import TransactionManager from './TransactionManager';
import { buildOptions } from './options';
import {
import {
interact,
introspect as introspectV2,
authenticate,
cancel,
register,
Expand Down Expand Up @@ -242,6 +244,8 @@ class OktaAuth implements SDKInterface, SigninAPI, SignoutAPI {

// IDX
this.idx = {
interact: interact.bind(null, this),
introspect: introspectV2.bind(null, this),
authenticate: authenticate.bind(null, this),
register: register.bind(null, this),
cancel: cancel.bind(null, this),
Expand Down
2 changes: 2 additions & 0 deletions lib/idx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

export * from './authenticate';
export * from './cancel';
export * from './interact';
export * from './introspect';
export * from './register';
export * from './recoverPassword';
export * from './handleInteractionCodeRedirect';
Expand Down
2 changes: 1 addition & 1 deletion lib/idx/introspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { IdxResponse, RawIdxResponse } from './types/idx-js';
import { getOAuthDomain } from '../oidc';
import { IDX_API_VERSION } from '../constants';

interface IntrospectOptions {
export interface IntrospectOptions {
interactionHandle: string;
stateHandle?: string;
}
Expand Down
6 changes: 5 additions & 1 deletion lib/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import {
IdxOptions,
IdxTransaction,
} from '../idx/types';

import { InteractOptions, InteractResponse } from '../idx/interact';
import { IntrospectOptions } from '../idx/introspect';
import { IdxResponse } from '../idx/types/idx-js';
export interface OktaAuth {
options: OktaAuthOptions;
getIssuerOrigin(): string;
Expand Down Expand Up @@ -250,6 +252,8 @@ export interface PkceAPI {
}

export interface IdxAPI {
interact: (options?: InteractOptions) => Promise<InteractResponse>;
introspect: (options?: IntrospectOptions) => Promise<IdxResponse>;
authenticate: (options: AuthenticationOptions) => Promise<IdxTransaction>;
register: (options: IdxRegistrationOptions) => Promise<IdxTransaction>;
cancel: (options?: CancelOptions) => Promise<IdxTransaction>;
Expand Down

0 comments on commit 5c304f8

Please sign in to comment.