@okta/okta-auth-js 6.4.0 → 6.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/cjs/OktaAuth.js.map +1 -1
- package/cjs/OktaUserAgent.js +2 -2
- package/cjs/ServiceManager.js +1 -1
- package/cjs/ServiceManager.js.map +1 -1
- package/cjs/TransactionManager.js +25 -13
- package/cjs/TransactionManager.js.map +1 -1
- package/cjs/crypto/node.js +11 -16
- package/cjs/crypto/node.js.map +1 -1
- package/cjs/errors/AuthApiError.js.map +1 -1
- package/cjs/errors/AuthSdkError.js.map +1 -1
- package/cjs/idx/authenticate.js.map +1 -1
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +1 -1
- package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -1
- package/cjs/idx/authenticator/SecurityQuestionVerification.js +12 -1
- package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
- package/cjs/idx/cancel.js.map +1 -1
- package/cjs/idx/idxState/v1/generateIdxAction.js +0 -2
- package/cjs/idx/idxState/v1/generateIdxAction.js.map +1 -1
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/introspect.js +1 -1
- package/cjs/idx/introspect.js.map +1 -1
- package/cjs/idx/proceed.js.map +1 -1
- package/cjs/idx/recoverPassword.js.map +1 -1
- package/cjs/idx/register.js.map +1 -1
- package/cjs/idx/remediate.js +12 -12
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
- package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -1
- package/cjs/idx/run.js +33 -4
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/startTransaction.js.map +1 -1
- package/cjs/idx/types/api.js +42 -0
- package/cjs/idx/types/api.js.map +1 -0
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js +27 -51
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/idx/types/options.js +2 -0
- package/cjs/idx/types/options.js.map +1 -0
- package/cjs/idx/unlockAccount.js.map +1 -1
- package/cjs/oidc/exchangeCodeForTokens.js.map +1 -1
- package/cjs/types/Transaction.js.map +1 -1
- package/dist/okta-auth-js.min.js +1 -1
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.umd.js +1 -1
- package/dist/okta-auth-js.umd.js.map +1 -1
- package/esm/esm.browser.js +93 -65
- package/esm/esm.browser.js.map +1 -1
- package/esm/esm.node.mjs +93 -65
- package/esm/esm.node.mjs.map +1 -1
- package/lib/OktaAuth.d.ts +2 -2
- package/lib/TransactionManager.d.ts +4 -3
- package/lib/errors/AuthApiError.d.ts +2 -2
- package/lib/errors/AuthSdkError.d.ts +2 -2
- package/lib/idx/authenticate.d.ts +1 -3
- package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +1 -0
- package/lib/idx/cancel.d.ts +2 -3
- package/lib/idx/emailVerify.d.ts +1 -1
- package/lib/idx/idxState/v1/generateIdxAction.d.ts +2 -2
- package/lib/idx/interact.d.ts +1 -16
- package/lib/idx/introspect.d.ts +1 -7
- package/lib/idx/proceed.d.ts +1 -9
- package/lib/idx/recoverPassword.d.ts +1 -3
- package/lib/idx/register.d.ts +1 -3
- package/lib/idx/remediate.d.ts +1 -9
- package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +1 -2
- package/lib/idx/remediators/Base/Remediator.d.ts +2 -2
- package/lib/idx/remediators/EnrollmentChannelData.d.ts +3 -3
- package/lib/idx/remediators/SelectEnrollmentChannel.d.ts +3 -3
- package/lib/idx/run.d.ts +1 -10
- package/lib/idx/startTransaction.d.ts +2 -3
- package/lib/idx/types/api.d.ts +98 -0
- package/lib/idx/types/idx-js.d.ts +10 -3
- package/lib/idx/types/index.d.ts +4 -110
- package/lib/idx/types/options.d.ts +44 -0
- package/lib/idx/unlockAccount.d.ts +1 -3
- package/lib/types/OAuth.d.ts +2 -0
- package/lib/types/OktaAuthOptions.d.ts +27 -11
- package/lib/types/Storage.d.ts +2 -1
- package/lib/types/Transaction.d.ts +8 -28
- package/lib/types/api.d.ts +12 -36
- package/package.json +4 -3
|
@@ -14,9 +14,10 @@ import { CookieOptions } from './Cookies';
|
|
|
14
14
|
import { HttpRequestClient } from './http';
|
|
15
15
|
import { AuthState } from './AuthState';
|
|
16
16
|
import { TransactionManagerOptions } from './Transaction';
|
|
17
|
-
import {
|
|
17
|
+
import { IdxTransactionMeta } from '../idx/types';
|
|
18
18
|
import { ServiceManagerOptions } from './Service';
|
|
19
19
|
import OktaAuth from '../OktaAuth';
|
|
20
|
+
import { OAuthResponseMode, OAuthResponseType } from './OAuth';
|
|
20
21
|
export interface IsAuthenticatedOptions {
|
|
21
22
|
onExpiredToken?: 'renew' | 'remove' | 'none';
|
|
22
23
|
}
|
|
@@ -39,16 +40,36 @@ export interface CustomUrls {
|
|
|
39
40
|
revokeUrl?: string;
|
|
40
41
|
logoutUrl?: string;
|
|
41
42
|
}
|
|
42
|
-
export interface
|
|
43
|
+
export interface TokenParams extends CustomUrls {
|
|
43
44
|
pkce?: boolean;
|
|
44
45
|
clientId?: string;
|
|
45
46
|
redirectUri?: string;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
responseMode?: string;
|
|
49
|
-
scopes?: string[];
|
|
47
|
+
responseType?: OAuthResponseType | OAuthResponseType[];
|
|
48
|
+
responseMode?: OAuthResponseMode;
|
|
50
49
|
state?: string;
|
|
50
|
+
nonce?: string;
|
|
51
|
+
scopes?: string[];
|
|
52
|
+
display?: string;
|
|
51
53
|
ignoreSignature?: boolean;
|
|
54
|
+
codeVerifier?: string;
|
|
55
|
+
authorizationCode?: string;
|
|
56
|
+
codeChallenge?: string;
|
|
57
|
+
codeChallengeMethod?: string;
|
|
58
|
+
interactionCode?: string;
|
|
59
|
+
idp?: string;
|
|
60
|
+
idpScope?: string | string[];
|
|
61
|
+
loginHint?: string;
|
|
62
|
+
maxAge?: string | number;
|
|
63
|
+
prompt?: string;
|
|
64
|
+
sessionToken?: string;
|
|
65
|
+
timeout?: number;
|
|
66
|
+
extraParams?: {
|
|
67
|
+
[propName: string]: string;
|
|
68
|
+
};
|
|
69
|
+
popupTitle?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface OktaAuthOptions extends CustomUrls, Pick<TokenParams, 'issuer' | 'clientId' | 'redirectUri' | 'responseType' | 'responseMode' | 'scopes' | 'state' | 'pkce' | 'ignoreSignature' | 'codeChallenge' | 'codeChallengeMethod'>, Pick<IdxTransactionMeta, 'flow' | 'activationToken' | 'recoveryToken'> {
|
|
72
|
+
useInteractionCodeFlow?: boolean;
|
|
52
73
|
ignoreLifetime?: boolean;
|
|
53
74
|
tokenManager?: TokenManagerOptions;
|
|
54
75
|
postLogoutRedirectUri?: string;
|
|
@@ -65,10 +86,5 @@ export interface OktaAuthOptions extends CustomUrls {
|
|
|
65
86
|
storageManager?: StorageManagerOptions;
|
|
66
87
|
services?: ServiceManagerOptions;
|
|
67
88
|
transactionManager?: TransactionManagerOptions;
|
|
68
|
-
flow?: FlowIdentifier;
|
|
69
|
-
codeChallenge?: string;
|
|
70
|
-
codeChallengeMethod?: string;
|
|
71
|
-
recoveryToken?: string;
|
|
72
|
-
activationToken?: string;
|
|
73
89
|
clientSecret?: string;
|
|
74
90
|
}
|
package/lib/types/Storage.d.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { TransactionMeta } from './Transaction';
|
|
13
13
|
import { Cookies, CookieOptions } from './Cookies';
|
|
14
14
|
import { RawIdxResponse } from '../idx/types/idx-js';
|
|
15
|
+
import { IntrospectOptions } from '.';
|
|
15
16
|
export interface TxStorage {
|
|
16
17
|
get(name: string): string;
|
|
17
18
|
set(name: string, value: string, expiresAt: string, options: CookieOptions): string;
|
|
@@ -40,7 +41,7 @@ export interface TransactionStorage extends StorageProvider {
|
|
|
40
41
|
setStorage(obj: TransactionMeta): void;
|
|
41
42
|
getStorage(): TransactionMeta;
|
|
42
43
|
}
|
|
43
|
-
export interface SavedIdxResponse {
|
|
44
|
+
export interface SavedIdxResponse extends Pick<IntrospectOptions, 'stateHandle' | 'interactionHandle'> {
|
|
44
45
|
rawIdxResponse: RawIdxResponse;
|
|
45
46
|
requestDidSucceed?: boolean;
|
|
46
47
|
}
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { StorageManager } from '../StorageManager';
|
|
13
|
-
import { CustomUrls } from './OktaAuthOptions';
|
|
14
|
-
import {
|
|
13
|
+
import { CustomUrls, TokenParams } from './OktaAuthOptions';
|
|
14
|
+
import { IdxTransactionMeta } from '../idx/types';
|
|
15
15
|
export interface TransactionManagerOptions {
|
|
16
16
|
storageManager?: StorageManager;
|
|
17
17
|
enableSharedStorage?: boolean;
|
|
@@ -21,38 +21,18 @@ export interface TransactionManagerOptions {
|
|
|
21
21
|
saveParamsCookie?: boolean;
|
|
22
22
|
saveLastResponse?: boolean;
|
|
23
23
|
}
|
|
24
|
-
export interface
|
|
25
|
-
pkce?: boolean;
|
|
26
|
-
oauth?: boolean;
|
|
27
|
-
muteWarning?: boolean;
|
|
28
|
-
state?: string;
|
|
29
|
-
flow?: FlowIdentifier;
|
|
30
|
-
codeVerifier?: string;
|
|
31
|
-
codeChallenge?: string;
|
|
32
|
-
codeChallengeMethod?: string;
|
|
33
|
-
activationToken?: string;
|
|
34
|
-
recoveryToken?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface OAuthTransactionMeta {
|
|
37
|
-
issuer: string;
|
|
38
|
-
redirectUri: string;
|
|
39
|
-
state: string;
|
|
40
|
-
nonce: string;
|
|
41
|
-
responseType: string | string[];
|
|
42
|
-
responseMode?: string;
|
|
43
|
-
scopes: string[];
|
|
44
|
-
clientId: string;
|
|
24
|
+
export interface OAuthTransactionMeta extends Pick<TokenParams, 'issuer' | 'clientId' | 'redirectUri' | 'responseType' | 'responseMode' | 'scopes' | 'state' | 'pkce' | 'ignoreSignature' | 'nonce'> {
|
|
45
25
|
urls: CustomUrls;
|
|
46
|
-
ignoreSignature: boolean;
|
|
47
26
|
originalUri?: string;
|
|
48
27
|
}
|
|
49
|
-
export interface PKCETransactionMeta extends OAuthTransactionMeta {
|
|
50
|
-
codeVerifier: string;
|
|
51
|
-
codeChallengeMethod: string;
|
|
52
|
-
codeChallenge: string;
|
|
28
|
+
export interface PKCETransactionMeta extends OAuthTransactionMeta, Pick<TokenParams, 'codeChallenge' | 'codeChallengeMethod' | 'codeVerifier'> {
|
|
53
29
|
}
|
|
54
30
|
export declare type CustomAuthTransactionMeta = Record<string, string | undefined>;
|
|
55
31
|
export declare type TransactionMeta = IdxTransactionMeta | PKCETransactionMeta | OAuthTransactionMeta | CustomAuthTransactionMeta;
|
|
32
|
+
export interface TransactionMetaOptions extends Pick<IdxTransactionMeta, 'pkce' | 'state' | 'codeChallenge' | 'codeChallengeMethod' | 'codeVerifier' | 'flow' | 'activationToken' | 'recoveryToken'> {
|
|
33
|
+
oauth?: boolean;
|
|
34
|
+
muteWarning?: boolean;
|
|
35
|
+
}
|
|
56
36
|
export declare function isOAuthTransactionMeta(obj: any): obj is OAuthTransactionMeta;
|
|
57
37
|
export declare function isPKCETransactionMeta(obj: any): obj is PKCETransactionMeta;
|
|
58
38
|
export declare function isIdxTransactionMeta(obj: any): obj is IdxTransactionMeta;
|
package/lib/types/api.d.ts
CHANGED
|
@@ -13,16 +13,13 @@ import { AuthTransaction } from '../tx/AuthTransaction';
|
|
|
13
13
|
import { Token, Tokens, RevocableToken, AccessToken, IDToken, RefreshToken } from './Token';
|
|
14
14
|
import { JWTObject } from './JWT';
|
|
15
15
|
import { UserClaims } from './UserClaims';
|
|
16
|
-
import { CustomUrls, OktaAuthOptions } from './OktaAuthOptions';
|
|
16
|
+
import { CustomUrls, OktaAuthOptions, TokenParams } from './OktaAuthOptions';
|
|
17
17
|
import { StorageManager } from '../StorageManager';
|
|
18
18
|
import TransactionManager from '../TransactionManager';
|
|
19
19
|
import { TokenManagerInterface } from './TokenManager';
|
|
20
20
|
import { ServiceManagerInterface } from './Service';
|
|
21
21
|
import { OktaUserAgent } from '../OktaUserAgent';
|
|
22
|
-
import { AuthenticationOptions, RegistrationOptions as IdxRegistrationOptions, PasswordRecoveryOptions, AccountUnlockOptions, ProceedOptions, CancelOptions,
|
|
23
|
-
import { InteractOptions, InteractResponse } from '../idx/interact';
|
|
24
|
-
import { IntrospectOptions } from '../idx/introspect';
|
|
25
|
-
import { IdxResponse } from '../idx/types/idx-js';
|
|
22
|
+
import { AuthenticationOptions, RegistrationOptions as IdxRegistrationOptions, PasswordRecoveryOptions, AccountUnlockOptions, ProceedOptions, CancelOptions, IdxTransaction, IdxTransactionMeta, EmailVerifyCallbackResponse, IdxAuthenticator, ChallengeData, ActivationData, WebauthnEnrollValues, WebauthnVerificationValues, FlowIdentifier, IdxPollOptions, IdxResponse, IntrospectOptions, InteractOptions, InteractResponse, StartOptions } from '../idx/types';
|
|
26
23
|
import { TransactionMetaOptions } from './Transaction';
|
|
27
24
|
export interface OktaAuthInterface {
|
|
28
25
|
options: OktaAuthOptions;
|
|
@@ -37,12 +34,19 @@ export interface OktaAuthInterface {
|
|
|
37
34
|
features: FeaturesAPI;
|
|
38
35
|
token: TokenAPI;
|
|
39
36
|
}
|
|
37
|
+
export interface FieldError {
|
|
38
|
+
errorSummary: string;
|
|
39
|
+
reason?: string;
|
|
40
|
+
location?: string;
|
|
41
|
+
locationType?: string;
|
|
42
|
+
domain?: string;
|
|
43
|
+
}
|
|
40
44
|
export interface APIError {
|
|
41
45
|
errorSummary: string;
|
|
42
46
|
errorCode?: string;
|
|
43
47
|
errorLink?: string;
|
|
44
48
|
errorId?: string;
|
|
45
|
-
errorCauses?:
|
|
49
|
+
errorCauses?: Array<FieldError>;
|
|
46
50
|
}
|
|
47
51
|
export interface HttpAPI {
|
|
48
52
|
setRequestHeader(name: string, value: string): void;
|
|
@@ -73,34 +77,6 @@ export interface SessionAPI {
|
|
|
73
77
|
refresh: () => Promise<object>;
|
|
74
78
|
setCookieAndRedirect: (sessionToken?: string, redirectUri?: string) => void;
|
|
75
79
|
}
|
|
76
|
-
export interface TokenParams extends CustomUrls {
|
|
77
|
-
pkce?: boolean;
|
|
78
|
-
clientId?: string;
|
|
79
|
-
redirectUri?: string;
|
|
80
|
-
responseType?: string | string[];
|
|
81
|
-
responseMode?: string;
|
|
82
|
-
state?: string;
|
|
83
|
-
nonce?: string;
|
|
84
|
-
scopes?: string[];
|
|
85
|
-
display?: string;
|
|
86
|
-
ignoreSignature?: boolean;
|
|
87
|
-
codeVerifier?: string;
|
|
88
|
-
authorizationCode?: string;
|
|
89
|
-
codeChallenge?: string;
|
|
90
|
-
codeChallengeMethod?: string;
|
|
91
|
-
interactionCode?: string;
|
|
92
|
-
idp?: string;
|
|
93
|
-
idpScope?: string | string[];
|
|
94
|
-
loginHint?: string;
|
|
95
|
-
maxAge?: string | number;
|
|
96
|
-
prompt?: string;
|
|
97
|
-
sessionToken?: string;
|
|
98
|
-
timeout?: number;
|
|
99
|
-
extraParams?: {
|
|
100
|
-
[propName: string]: string;
|
|
101
|
-
};
|
|
102
|
-
popupTitle?: string;
|
|
103
|
-
}
|
|
104
80
|
export interface PopupParams {
|
|
105
81
|
popupTitle?: string;
|
|
106
82
|
popupWindow?: Window;
|
|
@@ -231,13 +207,13 @@ export interface IdxAPI {
|
|
|
231
207
|
recoverPassword: (options?: PasswordRecoveryOptions) => Promise<IdxTransaction>;
|
|
232
208
|
unlockAccount: (options?: AccountUnlockOptions) => Promise<IdxTransaction>;
|
|
233
209
|
poll: (options?: IdxPollOptions) => Promise<IdxTransaction>;
|
|
234
|
-
start: (options?:
|
|
210
|
+
start: (options?: StartOptions) => Promise<IdxTransaction>;
|
|
235
211
|
canProceed(options?: ProceedOptions): boolean;
|
|
236
212
|
proceed: (options?: ProceedOptions) => Promise<IdxTransaction>;
|
|
237
213
|
cancel: (options?: CancelOptions) => Promise<IdxTransaction>;
|
|
238
214
|
getFlow(): FlowIdentifier | undefined;
|
|
239
215
|
setFlow(flow: FlowIdentifier): void;
|
|
240
|
-
startTransaction: (options?:
|
|
216
|
+
startTransaction: (options?: StartOptions) => Promise<IdxTransaction>;
|
|
241
217
|
isInteractionRequired: (hashOrSearch?: string) => boolean;
|
|
242
218
|
isInteractionRequiredError: (error: Error) => boolean;
|
|
243
219
|
handleInteractionCodeRedirect: (url: string) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@okta/okta-auth-js",
|
|
4
4
|
"description": "The Okta Auth SDK",
|
|
5
|
-
"version": "6.4.
|
|
5
|
+
"version": "6.4.3",
|
|
6
6
|
"homepage": "https://github.com/okta/okta-auth-js",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"main": "cjs/index.js",
|
|
@@ -187,7 +187,8 @@
|
|
|
187
187
|
}
|
|
188
188
|
},
|
|
189
189
|
"okta": {
|
|
190
|
-
"commitSha": "
|
|
191
|
-
"fullVersion": "6.4.
|
|
190
|
+
"commitSha": "da8612f3b4db34472e7c358916cae15f68b65440",
|
|
191
|
+
"fullVersion": "6.4.3-gda8612f",
|
|
192
|
+
"testedSha": "caf5d17e0bb27cd8ba2e5862c63d5f26ac1d18d4"
|
|
192
193
|
}
|
|
193
194
|
}
|