@okta/okta-auth-js 5.4.3 → 5.8.0
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 +59 -4
- package/README.md +66 -977
- package/cjs/AuthStateManager.js +5 -0
- package/cjs/AuthStateManager.js.map +1 -1
- package/cjs/OktaAuth.js +74 -29
- package/cjs/OktaAuth.js.map +1 -1
- package/cjs/OktaUserAgent.js +2 -2
- package/cjs/StorageManager.js +16 -0
- package/cjs/StorageManager.js.map +1 -1
- package/cjs/TransactionManager.js +44 -8
- package/cjs/TransactionManager.js.map +1 -1
- package/cjs/browser/browserStorage.js +5 -5
- package/cjs/browser/browserStorage.js.map +1 -1
- package/cjs/builderUtil.js +6 -0
- package/cjs/builderUtil.js.map +1 -1
- package/cjs/constants.js +5 -1
- package/cjs/constants.js.map +1 -1
- package/cjs/fetch/fetchRequest.js +10 -3
- package/cjs/fetch/fetchRequest.js.map +1 -1
- package/cjs/http/request.js +4 -0
- package/cjs/http/request.js.map +1 -1
- package/cjs/idx/interact.js +5 -2
- package/cjs/idx/interact.js.map +1 -1
- package/cjs/idx/introspect.js +24 -7
- package/cjs/idx/introspect.js.map +1 -1
- package/cjs/idx/remediate.js +35 -41
- package/cjs/idx/remediate.js.map +1 -1
- package/cjs/idx/remediators/Base/AuthenticatorData.js +7 -7
- package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/cjs/idx/remediators/Base/Remediator.js +13 -7
- package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
- package/cjs/idx/remediators/Base/SelectAuthenticator.js +6 -6
- package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js +18 -14
- package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/cjs/idx/remediators/EnrollProfile.js +14 -0
- package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
- package/cjs/idx/remediators/Identify.js +5 -2
- package/cjs/idx/remediators/Identify.js.map +1 -1
- package/cjs/idx/remediators/ReEnrollAuthenticator.js +1 -1
- package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
- package/cjs/idx/run.js +28 -6
- package/cjs/idx/run.js.map +1 -1
- package/cjs/idx/transactionMeta.js +24 -9
- package/cjs/idx/transactionMeta.js.map +1 -1
- package/cjs/idx/types/idx-js.js +5 -0
- package/cjs/idx/types/idx-js.js.map +1 -1
- package/cjs/idx/types/index.js +17 -6
- package/cjs/idx/types/index.js.map +1 -1
- package/cjs/oidc/getToken.js +14 -9
- package/cjs/oidc/getToken.js.map +1 -1
- package/cjs/oidc/getWithPopup.js +9 -2
- package/cjs/oidc/getWithPopup.js.map +1 -1
- package/cjs/oidc/getWithRedirect.js.map +1 -1
- package/cjs/oidc/parseFromUrl.js +59 -20
- package/cjs/oidc/parseFromUrl.js.map +1 -1
- package/cjs/oidc/renewTokens.js +28 -5
- package/cjs/oidc/renewTokens.js.map +1 -1
- package/cjs/oidc/util/browser.js +1 -13
- package/cjs/oidc/util/browser.js.map +1 -1
- package/cjs/oidc/util/loginRedirect.js +9 -5
- package/cjs/oidc/util/loginRedirect.js.map +1 -1
- package/cjs/oidc/util/urlParams.js +1 -1
- package/cjs/oidc/util/urlParams.js.map +1 -1
- package/cjs/oidc/util/validateClaims.js +8 -6
- package/cjs/oidc/util/validateClaims.js.map +1 -1
- package/cjs/options.js +15 -2
- package/cjs/options.js.map +1 -1
- package/cjs/server/serverStorage.js +2 -1
- package/cjs/server/serverStorage.js.map +1 -1
- package/cjs/tx/AuthTransaction.js +1 -3
- package/cjs/tx/AuthTransaction.js.map +1 -1
- package/cjs/tx/api.js +3 -0
- package/cjs/tx/api.js.map +1 -1
- package/cjs/types/Transaction.js.map +1 -1
- package/cjs/util/emailVerify.js +28 -0
- package/cjs/util/emailVerify.js.map +1 -0
- package/cjs/util/index.js +13 -0
- package/cjs/util/index.js.map +1 -1
- package/cjs/util/sharedStorage.js +54 -0
- package/cjs/util/sharedStorage.js.map +1 -0
- package/dist/okta-auth-js.min.js +2 -74
- package/dist/okta-auth-js.min.js.LICENSE.txt +32 -0
- package/dist/okta-auth-js.min.js.map +1 -1
- package/dist/okta-auth-js.polyfill.js +2 -18
- package/dist/okta-auth-js.polyfill.js.LICENSE.txt +18 -0
- package/dist/okta-auth-js.polyfill.js.map +1 -1
- package/dist/okta-auth-js.umd.js +2 -74
- package/dist/okta-auth-js.umd.js.LICENSE.txt +32 -0
- package/dist/okta-auth-js.umd.js.map +1 -1
- package/esm/AuthStateManager.js +5 -0
- package/esm/AuthStateManager.js.map +1 -1
- package/esm/OktaAuth.js +75 -31
- package/esm/OktaAuth.js.map +1 -1
- package/esm/OktaUserAgent.js +2 -2
- package/esm/StorageManager.js +17 -1
- package/esm/StorageManager.js.map +1 -1
- package/esm/TransactionManager.js +43 -8
- package/esm/TransactionManager.js.map +1 -1
- package/esm/browser/browserStorage.js +5 -5
- package/esm/browser/browserStorage.js.map +1 -1
- package/esm/builderUtil.js +6 -0
- package/esm/builderUtil.js.map +1 -1
- package/esm/constants.js +2 -0
- package/esm/constants.js.map +1 -1
- package/esm/fetch/fetchRequest.js +10 -3
- package/esm/fetch/fetchRequest.js.map +1 -1
- package/esm/http/request.js +4 -0
- package/esm/http/request.js.map +1 -1
- package/esm/idx/interact.js +5 -2
- package/esm/idx/interact.js.map +1 -1
- package/esm/idx/introspect.js +22 -6
- package/esm/idx/introspect.js.map +1 -1
- package/esm/idx/remediate.js +36 -37
- package/esm/idx/remediate.js.map +1 -1
- package/esm/idx/remediators/Base/AuthenticatorData.js +7 -7
- package/esm/idx/remediators/Base/AuthenticatorData.js.map +1 -1
- package/esm/idx/remediators/Base/Remediator.js +13 -8
- package/esm/idx/remediators/Base/Remediator.js.map +1 -1
- package/esm/idx/remediators/Base/SelectAuthenticator.js +6 -6
- package/esm/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
- package/esm/idx/remediators/Base/VerifyAuthenticator.js +18 -15
- package/esm/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
- package/esm/idx/remediators/EnrollProfile.js +21 -4
- package/esm/idx/remediators/EnrollProfile.js.map +1 -1
- package/esm/idx/remediators/Identify.js +4 -2
- package/esm/idx/remediators/Identify.js.map +1 -1
- package/esm/idx/remediators/ReEnrollAuthenticator.js +1 -1
- package/esm/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
- package/esm/idx/run.js +27 -6
- package/esm/idx/run.js.map +1 -1
- package/esm/idx/transactionMeta.js +23 -10
- package/esm/idx/transactionMeta.js.map +1 -1
- package/esm/idx/types/idx-js.js +3 -0
- package/esm/idx/types/idx-js.js.map +1 -1
- package/esm/idx/types/index.js +15 -5
- package/esm/idx/types/index.js.map +1 -1
- package/esm/oidc/getToken.js +15 -10
- package/esm/oidc/getToken.js.map +1 -1
- package/esm/oidc/getWithPopup.js +8 -2
- package/esm/oidc/getWithPopup.js.map +1 -1
- package/esm/oidc/getWithRedirect.js.map +1 -1
- package/esm/oidc/parseFromUrl.js +59 -17
- package/esm/oidc/parseFromUrl.js.map +1 -1
- package/esm/oidc/renewTokens.js +27 -5
- package/esm/oidc/renewTokens.js.map +1 -1
- package/esm/oidc/util/browser.js +1 -12
- package/esm/oidc/util/browser.js.map +1 -1
- package/esm/oidc/util/loginRedirect.js +9 -5
- package/esm/oidc/util/loginRedirect.js.map +1 -1
- package/esm/oidc/util/urlParams.js +1 -1
- package/esm/oidc/util/urlParams.js.map +1 -1
- package/esm/oidc/util/validateClaims.js +8 -6
- package/esm/oidc/util/validateClaims.js.map +1 -1
- package/esm/options.js +15 -2
- package/esm/options.js.map +1 -1
- package/esm/server/serverStorage.js +2 -1
- package/esm/server/serverStorage.js.map +1 -1
- package/esm/tx/AuthTransaction.js +1 -3
- package/esm/tx/AuthTransaction.js.map +1 -1
- package/esm/tx/api.js +3 -0
- package/esm/tx/api.js.map +1 -1
- package/esm/types/Transaction.js.map +1 -1
- package/esm/util/emailVerify.js +21 -0
- package/esm/util/emailVerify.js.map +1 -0
- package/esm/util/index.js +1 -0
- package/esm/util/index.js.map +1 -1
- package/esm/util/sharedStorage.js +43 -0
- package/esm/util/sharedStorage.js.map +1 -0
- package/lib/AuthStateManager.d.ts +4 -2
- package/lib/OktaAuth.d.ts +9 -5
- package/lib/StorageManager.d.ts +2 -0
- package/lib/TransactionManager.d.ts +5 -1
- package/lib/constants.d.ts +2 -0
- package/lib/crypto/base64.d.ts +2 -2
- package/lib/crypto/oidcHash.d.ts +1 -1
- package/lib/crypto/verifyToken.d.ts +1 -1
- package/lib/idx/introspect.d.ts +2 -1
- package/lib/idx/remediators/Base/AuthenticatorData.d.ts +2 -5
- package/lib/idx/remediators/Base/Remediator.d.ts +3 -6
- package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +3 -6
- package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +1 -1
- package/lib/idx/remediators/EnrollProfile.d.ts +1 -0
- package/lib/idx/remediators/Identify.d.ts +1 -5
- package/lib/idx/run.d.ts +1 -0
- package/lib/idx/transactionMeta.d.ts +4 -3
- package/lib/idx/types/idx-js.d.ts +2 -0
- package/lib/idx/types/index.d.ts +20 -9
- package/lib/oidc/getToken.d.ts +2 -2
- package/lib/oidc/parseFromUrl.d.ts +4 -1
- package/lib/oidc/renewTokens.d.ts +0 -12
- package/lib/oidc/util/loginRedirect.d.ts +1 -1
- package/lib/types/AuthState.d.ts +1 -0
- package/lib/types/OktaAuthOptions.d.ts +2 -1
- package/lib/types/Storage.d.ts +3 -0
- package/lib/types/Transaction.d.ts +5 -1
- package/lib/types/api.d.ts +9 -4
- package/lib/types/http.d.ts +1 -0
- package/lib/util/emailVerify.d.ts +17 -0
- package/lib/util/index.d.ts +1 -0
- package/lib/util/sharedStorage.d.ts +6 -0
- package/package.json +12 -10
package/lib/types/AuthState.d.ts
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
import { StorageManagerOptions, StorageUtil } from './Storage';
|
|
13
13
|
import { CookieOptions } from './Cookies';
|
|
14
14
|
import { HttpRequestClient } from './http';
|
|
15
|
-
import { OktaAuth } from './';
|
|
16
15
|
import { AuthState } from './AuthState';
|
|
17
16
|
import { TransactionManagerOptions } from './Transaction';
|
|
18
17
|
import { SimpleStorage } from './Storage';
|
|
18
|
+
import OktaAuth from '../OktaAuth';
|
|
19
19
|
export interface TokenManagerOptions {
|
|
20
20
|
autoRenew?: boolean;
|
|
21
21
|
autoRemove?: boolean;
|
|
@@ -48,6 +48,7 @@ export interface OktaAuthOptions extends CustomUrls {
|
|
|
48
48
|
scopes?: string[];
|
|
49
49
|
state?: string;
|
|
50
50
|
ignoreSignature?: boolean;
|
|
51
|
+
ignoreLifetime?: boolean;
|
|
51
52
|
tokenManager?: TokenManagerOptions;
|
|
52
53
|
postLogoutRedirectUri?: string;
|
|
53
54
|
storageUtil?: StorageUtil;
|
package/lib/types/Storage.d.ts
CHANGED
|
@@ -68,6 +68,9 @@ export interface BrowserStorageUtil extends StorageUtil {
|
|
|
68
68
|
getCookieStorage(options?: StorageOptions): CookieStorage;
|
|
69
69
|
testStorage(storage: any): boolean;
|
|
70
70
|
storage: Cookies;
|
|
71
|
+
inMemoryStore: {
|
|
72
|
+
string?: string;
|
|
73
|
+
};
|
|
71
74
|
getHttpCache(options?: StorageOptions): StorageProvider;
|
|
72
75
|
getPKCEStorage(options?: StorageOptions): PKCEStorage;
|
|
73
76
|
}
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
import StorageManager from '../StorageManager';
|
|
13
13
|
import { CustomUrls } from './OktaAuthOptions';
|
|
14
14
|
export interface TransactionManagerOptions {
|
|
15
|
-
storageManager
|
|
15
|
+
storageManager?: StorageManager;
|
|
16
|
+
enableSharedStorage?: boolean;
|
|
16
17
|
legacyWidgetSupport?: boolean;
|
|
17
18
|
saveNonceCookie?: boolean;
|
|
18
19
|
saveStateCookie?: boolean;
|
|
@@ -21,6 +22,8 @@ export interface TransactionManagerOptions {
|
|
|
21
22
|
export interface TransactionMetaOptions {
|
|
22
23
|
pkce?: boolean;
|
|
23
24
|
oauth?: boolean;
|
|
25
|
+
muteWarning?: boolean;
|
|
26
|
+
state?: string;
|
|
24
27
|
}
|
|
25
28
|
export interface OAuthTransactionMeta {
|
|
26
29
|
issuer: string;
|
|
@@ -32,6 +35,7 @@ export interface OAuthTransactionMeta {
|
|
|
32
35
|
clientId: string;
|
|
33
36
|
urls: CustomUrls;
|
|
34
37
|
ignoreSignature: boolean;
|
|
38
|
+
originalUri?: string;
|
|
35
39
|
}
|
|
36
40
|
export interface PKCETransactionMeta extends OAuthTransactionMeta {
|
|
37
41
|
codeVerifier: string;
|
package/lib/types/api.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export interface OktaAuth {
|
|
|
26
26
|
options: OktaAuthOptions;
|
|
27
27
|
userAgent: string;
|
|
28
28
|
getIssuerOrigin(): string;
|
|
29
|
+
getOriginalUri(): string;
|
|
29
30
|
_oktaUserAgent: OktaUserAgent;
|
|
30
31
|
storageManager: StorageManager;
|
|
31
32
|
transactionManager: TransactionManager;
|
|
@@ -95,6 +96,10 @@ export interface TokenParams extends CustomUrls {
|
|
|
95
96
|
timeout?: number;
|
|
96
97
|
popupTitle?: string;
|
|
97
98
|
}
|
|
99
|
+
export interface PopupParams {
|
|
100
|
+
popupTitle?: string;
|
|
101
|
+
popupWindow?: Window;
|
|
102
|
+
}
|
|
98
103
|
export interface TokenResponse {
|
|
99
104
|
tokens: Tokens;
|
|
100
105
|
state: string;
|
|
@@ -161,7 +166,7 @@ export interface SigninOptions extends SupportsCodeFlow, AuthenticationOptions {
|
|
|
161
166
|
context?: string;
|
|
162
167
|
sendFingerprint?: boolean;
|
|
163
168
|
}
|
|
164
|
-
export interface SigninWithRedirectOptions extends SigninOptions {
|
|
169
|
+
export interface SigninWithRedirectOptions extends SigninOptions, TokenParams {
|
|
165
170
|
originalUri?: string;
|
|
166
171
|
}
|
|
167
172
|
export interface SigninWithCredentialsOptions extends SigninOptions {
|
|
@@ -202,10 +207,10 @@ export interface PkceAPI {
|
|
|
202
207
|
export interface IdxAPI {
|
|
203
208
|
interact: (options?: InteractOptions) => Promise<InteractResponse>;
|
|
204
209
|
introspect: (options?: IntrospectOptions) => Promise<IdxResponse>;
|
|
205
|
-
authenticate: (options
|
|
206
|
-
register: (options
|
|
210
|
+
authenticate: (options?: AuthenticationOptions) => Promise<IdxTransaction>;
|
|
211
|
+
register: (options?: IdxRegistrationOptions) => Promise<IdxTransaction>;
|
|
207
212
|
cancel: (options?: CancelOptions) => Promise<IdxTransaction>;
|
|
208
213
|
startTransaction: (options?: IdxOptions) => Promise<IdxTransaction>;
|
|
209
|
-
recoverPassword: (options
|
|
214
|
+
recoverPassword: (options?: PasswordRecoveryOptions) => Promise<IdxTransaction>;
|
|
210
215
|
handleInteractionCodeRedirect: (url: string) => Promise<void>;
|
|
211
216
|
}
|
package/lib/types/http.d.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
export interface EmailVerifyCallbackResponse {
|
|
13
|
+
state: string;
|
|
14
|
+
stateTokenExternalId: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function isEmailVerifyCallback(urlPath: string): boolean;
|
|
17
|
+
export declare function parseEmailVerifyCallback(urlPath: string): EmailVerifyCallbackResponse;
|
package/lib/util/index.d.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TransactionMeta } from '../types';
|
|
2
|
+
import StorageManager from '../StorageManager';
|
|
3
|
+
export declare function pruneSharedStorage(storageManager: StorageManager): void;
|
|
4
|
+
export declare function saveTransactionToSharedStorage(storageManager: StorageManager, state: string, meta: TransactionMeta): void;
|
|
5
|
+
export declare function loadTransactionFromSharedStorage(storageManager: StorageManager, state: string): any;
|
|
6
|
+
export declare function clearTransactionFromSharedStorage(storageManager: StorageManager, state: string): 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": "5.
|
|
5
|
+
"version": "5.8.0",
|
|
6
6
|
"homepage": "https://github.com/okta/okta-auth-js",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"type": "commonjs",
|
|
@@ -36,12 +36,13 @@
|
|
|
36
36
|
"test:server": "jest --config ./jest.server.js",
|
|
37
37
|
"test:report": "yarn test --ci --silent || true",
|
|
38
38
|
"test:samples": "yarn workspace @okta/test.e2e.samples start",
|
|
39
|
+
"test:integration": "jest --config ./jest.integration.js",
|
|
39
40
|
"build": "node scripts/build.js",
|
|
40
|
-
"build:cdn": "cross-env NODE_ENV=production webpack --config webpack.cdn.config.js
|
|
41
|
-
"build:web": "cross-env NODE_ENV=production webpack --config webpack.config.js
|
|
41
|
+
"build:cdn": "cross-env NODE_ENV=production webpack --config webpack.cdn.config.js",
|
|
42
|
+
"build:web": "cross-env NODE_ENV=production webpack --config webpack.config.js",
|
|
42
43
|
"build:cjs": "cross-env babel lib -d build/cjs --config-file ./babel.cjs.js --extensions \".ts\",\".js\" --source-maps",
|
|
43
44
|
"build:esm": "cross-env babel lib -d build/esm --config-file ./babel.esm.js --extensions \".ts\",\".js\" --source-maps",
|
|
44
|
-
"build:polyfill": "cross-env NODE_ENV=production webpack --config webpack.polyfill.config.js
|
|
45
|
+
"build:polyfill": "cross-env NODE_ENV=production webpack --config webpack.polyfill.config.js",
|
|
45
46
|
"generate:samples": "yarn workspace @okta/samples build && yarn install --ignore-scripts",
|
|
46
47
|
"dev:samples": "yarn workspace @okta/samples dev",
|
|
47
48
|
"prepare": "",
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
},
|
|
70
71
|
"dependencies": {
|
|
71
72
|
"@babel/runtime": "^7.12.5",
|
|
72
|
-
"@okta/okta-idx-js": "0.
|
|
73
|
+
"@okta/okta-idx-js": "0.22.0",
|
|
73
74
|
"@peculiar/webcrypto": "1.1.6",
|
|
74
75
|
"Base64": "1.1.0",
|
|
75
76
|
"atob": "^2.1.2",
|
|
@@ -117,10 +118,11 @@
|
|
|
117
118
|
"lodash": "4.17.20",
|
|
118
119
|
"shelljs": "0.8.4",
|
|
119
120
|
"ts-jest": "^26.4.3",
|
|
120
|
-
"ts-loader": "^
|
|
121
|
+
"ts-loader": "^9.2.6",
|
|
121
122
|
"tsd": "^0.17.0",
|
|
122
123
|
"typescript": "^4.2.3",
|
|
123
|
-
"webpack": "^
|
|
124
|
+
"webpack": "^5.60.0",
|
|
125
|
+
"webpack-cli": "^4.9.1"
|
|
124
126
|
},
|
|
125
127
|
"jest-junit": {
|
|
126
128
|
"outputDirectory": "./build2/reports/unit/",
|
|
@@ -159,8 +161,8 @@
|
|
|
159
161
|
}
|
|
160
162
|
},
|
|
161
163
|
"okta": {
|
|
162
|
-
"commitSha": "
|
|
163
|
-
"fullVersion": "5.
|
|
164
|
-
"testedSha": "
|
|
164
|
+
"commitSha": "4a3e715f476ec4c4d10cf23f135663e10063e8b2",
|
|
165
|
+
"fullVersion": "5.8.0-g4a3e715",
|
|
166
|
+
"testedSha": "787f7afc5cf80315eeb0691b4c72b9a42f5481ce"
|
|
165
167
|
}
|
|
166
168
|
}
|