@forgerock/javascript-sdk
Advanced tools
Comparing version 3.0.0-beta1 to 3.0.0
# Changelog | ||
## [Unreleased] | ||
## [3.0.0] - 2020-6-24 | ||
### Added | ||
- Native Social Login callbacks for Identity Providers Google, Apple and Facebook | ||
- "Native" Social Login callbacks for both the original AM nodes in 6.5 and the new IDM nodes in 7.0 | ||
- SDK Social Login feature officially supports Apple, Facebook and Google | ||
- New `FRAuth` methods for handing redirection to provider and resuming an authentication journey | ||
- `FRAuth.resume` supports both return from an IdP and returning from Email Suspend node | ||
- `FRAuth.redirect` for redirecting to an Identity Provider for authentication | ||
- `FRAuth.resume` supports both return from an IdP and returning from Email Suspend node | ||
- New `FRAuth.start` method that aliases `FRAuth.next` to align native mobile SDKs | ||
- E2E test pages will now follow your OS's dark mode setting | ||
### Fixed | ||
- Arbitrary query parameters now passed along to authorize URL creation | ||
- Arbitrary query parameters are now passed along through to the `/authorize` endpoint supporting the use of ACR values for tree specificity | ||
- Fixed build issue when using Windows PowerShell | ||
- WebAuthn error handling is now standardized according to the WebAuthn spec | ||
- When WebAuthn encounters an error, it formats it appropriately and injects it into the hiddenCallback, allowing the developer to just send to AM or handle it specially (error is still thrown). | ||
- When WebAuthn encounters an error, the SDK now formats the error appropriately for AM and sets it into the hiddenValueCallback; this allows the developer to just send it to AM "as is" or handle it specially when catching the thrown error | ||
- Changed the default behavior in case of unidentified storage, to be the localStorage option | ||
- Increased timeout (20 to 60 seconds) for E2E tests to avoid pure timeout failures | ||
### Breaking | ||
- WebAuthn's thrown error messaging text has been changed to align with spec, so check all conditionals comparing message strings. | ||
- WebAuthn's thrown error message text has been changed to align with spec, so check all conditionals comparing error message strings | ||
- Renamed `getAuthorizeUrl` method to `getAuthCodeByIframe` | ||
- Removed the single parameter from `createVerifier` function | ||
- Removal of `nonce` function | ||
@@ -23,0 +31,0 @@ ## [2.2.0] - 2020-12-18 |
@@ -415,5 +415,3 @@ /* | ||
var rp = __assign({ name: relyingPartyName }, (rpId && { id: rpId })); | ||
return __assign(__assign({ attestation: attestationPreference, authenticatorSelection: JSON.parse(authenticatorSelection), challenge: Uint8Array.from(atob(challenge), function (c) { return c.charCodeAt(0); }).buffer }, (excludeCredentials.length && { excludeCredentials: excludeCredentials })), { pubKeyCredParams: pubKeyCredParams, | ||
rp: rp, | ||
timeout: timeout, user: { | ||
return __assign(__assign({ attestation: attestationPreference, authenticatorSelection: JSON.parse(authenticatorSelection), challenge: Uint8Array.from(atob(challenge), function (c) { return c.charCodeAt(0); }).buffer }, (excludeCredentials.length && { excludeCredentials: excludeCredentials })), { pubKeyCredParams: pubKeyCredParams, rp: rp, timeout: timeout, user: { | ||
displayName: displayName || userName, | ||
@@ -420,0 +418,0 @@ id: Int8Array.from(userId.split('').map(function (c) { return c.charCodeAt(0); })), |
@@ -136,6 +136,5 @@ /* | ||
var rpId = getIndexOne(text.match(/rpId"{0,}:\s{0,}\\{0,}"([^"\\]*)/)); | ||
return __assign(__assign(__assign({ challenge: challenge, | ||
timeout: timeout }, (allowCredentials && { allowCredentials: allowCredentials })), (userVerification && { userVerification: userVerification })), (rpId && { rpId: rpId })); | ||
return __assign(__assign(__assign({ challenge: challenge, timeout: timeout }, (allowCredentials && { allowCredentials: allowCredentials })), (userVerification && { userVerification: userVerification })), (rpId && { rpId: rpId })); | ||
} | ||
export { parseWebAuthnAuthenticateText, parseWebAuthnRegisterText }; | ||
//# sourceMappingURL=script-parser.js.map |
@@ -47,5 +47,4 @@ import Auth from './auth'; | ||
import Deferred from './util/deferred'; | ||
import nonce from './util/nonce'; | ||
import PKCE from './util/pkce'; | ||
import LocalStorage from './util/storage'; | ||
export { defaultMessageCreator, nonce, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackContainer, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FREvent, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUI, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, Listener, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackContainer, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FREvent, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUI, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, Listener, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; |
@@ -6,3 +6,3 @@ /* | ||
* | ||
* Copyright (c) 2020 ForgeRock. All rights reserved. | ||
* Copyright (c) 2020-2021 ForgeRock. All rights reserved. | ||
* This software may be modified and distributed under the terms | ||
@@ -54,6 +54,5 @@ * of the MIT license. See the LICENSE file for details. | ||
import Deferred from './util/deferred'; | ||
import nonce from './util/nonce'; | ||
import PKCE from './util/pkce'; | ||
import LocalStorage from './util/storage'; | ||
export { defaultMessageCreator, nonce, AttributeInputCallback, Auth, CallbackType, ChoiceCallback, Config, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FRAuth, FRCallback, FRDevice, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRUser, FRWebAuthn, HiddenValueCallback, HttpClient, KbaCreateCallback, LocalStorage, MetadataCallback, NameCallback, OAuth2Client, PasswordCallback, PKCE, PolicyKey, PollingWaitCallback, ReCaptchaCallback, RedirectCallback, ResponseType, SelectIdPCallback, SessionManager, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextOutputCallback, TokenManager, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, WebAuthnOutcome, WebAuthnStepType, }; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, CallbackType, ChoiceCallback, Config, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FRAuth, FRCallback, FRDevice, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRUser, FRWebAuthn, HiddenValueCallback, HttpClient, KbaCreateCallback, LocalStorage, MetadataCallback, NameCallback, OAuth2Client, PasswordCallback, PKCE, PolicyKey, PollingWaitCallback, ReCaptchaCallback, RedirectCallback, ResponseType, SelectIdPCallback, SessionManager, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextOutputCallback, TokenManager, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, WebAuthnOutcome, WebAuthnStepType, }; | ||
//# sourceMappingURL=index.js.map |
@@ -17,8 +17,10 @@ import { ConfigOptions } from '../config/index'; | ||
/** | ||
* DEPRECATED | ||
* Calls the authorize URL with an iframe. If successful, | ||
* it returns the callback URL with authentication code, | ||
* optionally using PKCE. | ||
* Method renamed in v3. | ||
* Original Name: getAuthorizeUrl | ||
* New Name: getAuthCodeByIframe | ||
*/ | ||
static getAuthorizeUrl(options: GetAuthorizationUrlOptions): Promise<string>; | ||
static getAuthCodeByIframe(options: GetAuthorizationUrlOptions): Promise<string>; | ||
/** | ||
@@ -25,0 +27,0 @@ * Exchanges an authorization code for OAuth tokens. |
@@ -6,3 +6,3 @@ /* | ||
* | ||
* Copyright (c) 2020 ForgeRock. All rights reserved. | ||
* Copyright (c) 2020-2021 ForgeRock. All rights reserved. | ||
* This software may be modified and distributed under the terms | ||
@@ -111,8 +111,10 @@ * of the MIT license. See the LICENSE file for details. | ||
/** | ||
* DEPRECATED | ||
* Calls the authorize URL with an iframe. If successful, | ||
* it returns the callback URL with authentication code, | ||
* optionally using PKCE. | ||
* Method renamed in v3. | ||
* Original Name: getAuthorizeUrl | ||
* New Name: getAuthCodeByIframe | ||
*/ | ||
OAuth2Client.getAuthorizeUrl = function (options) { | ||
OAuth2Client.getAuthCodeByIframe = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -123,5 +125,3 @@ var url, serverConfig; | ||
switch (_a.label) { | ||
case 0: | ||
console.warn('Deprecation warning: this `getAuthorizeUrl` method will be renamed in v3.'); | ||
return [4 /*yield*/, this.createAuthorizeUrl(options)]; | ||
case 0: return [4 /*yield*/, this.createAuthorizeUrl(options)]; | ||
case 1: | ||
@@ -128,0 +128,0 @@ url = _a.sent(); |
@@ -6,3 +6,3 @@ /* | ||
* | ||
* Copyright (c) 2020 ForgeRock. All rights reserved. | ||
* Copyright (c) 2020-2021 ForgeRock. All rights reserved. | ||
* This software may be modified and distributed under the terms | ||
@@ -170,3 +170,3 @@ * of the MIT license. See the LICENSE file for details. | ||
_e = URL.bind; | ||
return [4 /*yield*/, OAuth2Client.getAuthorizeUrl(authorizeUrlOptions)]; | ||
return [4 /*yield*/, OAuth2Client.getAuthCodeByIframe(authorizeUrlOptions)]; | ||
case 14: | ||
@@ -173,0 +173,0 @@ // To support legacy browsers, iframe works best with short timeout |
@@ -6,3 +6,3 @@ /* | ||
* | ||
* Copyright (c) 2020 ForgeRock. All rights reserved. | ||
* Copyright (c) 2020-2021 ForgeRock. All rights reserved. | ||
* This software may be modified and distributed under the terms | ||
@@ -86,5 +86,5 @@ * of the MIT license. See the LICENSE file for details. | ||
return [2 /*return*/, _b.sent()]; | ||
case 8: return [4 /*yield*/, IndexedDBWrapper.get(clientId)]; | ||
case 8: return [4 /*yield*/, LocalStorageWrapper.get(clientId)]; | ||
case 9: | ||
// if tokenStore is undefined, default to previous behavior | ||
// if tokenStore is undefined, default to localStorage | ||
return [2 /*return*/, _b.sent()]; | ||
@@ -122,5 +122,5 @@ } | ||
return [2 /*return*/, _b.sent()]; | ||
case 8: return [4 /*yield*/, IndexedDBWrapper.set(clientId, tokens)]; | ||
case 8: return [4 /*yield*/, LocalStorageWrapper.set(clientId, tokens)]; | ||
case 9: | ||
// if tokenStore is undefined, default to previous behavior | ||
// if tokenStore is undefined, default to localStorage | ||
return [2 /*return*/, _b.sent()]; | ||
@@ -158,5 +158,5 @@ } | ||
return [2 /*return*/, _b.sent()]; | ||
case 8: return [4 /*yield*/, IndexedDBWrapper.remove(clientId)]; | ||
case 8: return [4 /*yield*/, LocalStorageWrapper.remove(clientId)]; | ||
case 9: | ||
// if tokenStore is undefined, default to previous behavior | ||
// if tokenStore is undefined, default to localStorage | ||
return [2 /*return*/, _b.sent()]; | ||
@@ -163,0 +163,0 @@ } |
@@ -13,3 +13,3 @@ /** | ||
*/ | ||
static createVerifier(num?: number): string; | ||
static createVerifier(): string; | ||
/** | ||
@@ -16,0 +16,0 @@ * Creates a SHA-256 hash of the verifier. |
@@ -6,3 +6,3 @@ /* | ||
* | ||
* Copyright (c) 2020 ForgeRock. All rights reserved. | ||
* Copyright (c) 2020-2021 ForgeRock. All rights reserved. | ||
* This software may be modified and distributed under the terms | ||
@@ -63,7 +63,4 @@ * of the MIT license. See the LICENSE file for details. | ||
*/ | ||
PKCE.createVerifier = function (num) { | ||
if (num) { | ||
console.warn('Deprecation warning: the parameter for `createVerifier` will be removed in v3'); | ||
} | ||
return this.createRandomString(num || 32); | ||
PKCE.createVerifier = function () { | ||
return this.createRandomString(32); | ||
}; | ||
@@ -70,0 +67,0 @@ /** |
@@ -420,5 +420,3 @@ "use strict"; | ||
var rp = __assign({ name: relyingPartyName }, (rpId && { id: rpId })); | ||
return __assign(__assign({ attestation: attestationPreference, authenticatorSelection: JSON.parse(authenticatorSelection), challenge: Uint8Array.from(atob(challenge), function (c) { return c.charCodeAt(0); }).buffer }, (excludeCredentials.length && { excludeCredentials: excludeCredentials })), { pubKeyCredParams: pubKeyCredParams, | ||
rp: rp, | ||
timeout: timeout, user: { | ||
return __assign(__assign({ attestation: attestationPreference, authenticatorSelection: JSON.parse(authenticatorSelection), challenge: Uint8Array.from(atob(challenge), function (c) { return c.charCodeAt(0); }).buffer }, (excludeCredentials.length && { excludeCredentials: excludeCredentials })), { pubKeyCredParams: pubKeyCredParams, rp: rp, timeout: timeout, user: { | ||
displayName: displayName || userName, | ||
@@ -425,0 +423,0 @@ id: Int8Array.from(userId.split('').map(function (c) { return c.charCodeAt(0); })), |
@@ -140,6 +140,5 @@ "use strict"; | ||
var rpId = helpers_1.getIndexOne(text.match(/rpId"{0,}:\s{0,}\\{0,}"([^"\\]*)/)); | ||
return __assign(__assign(__assign({ challenge: challenge, | ||
timeout: timeout }, (allowCredentials && { allowCredentials: allowCredentials })), (userVerification && { userVerification: userVerification })), (rpId && { rpId: rpId })); | ||
return __assign(__assign(__assign({ challenge: challenge, timeout: timeout }, (allowCredentials && { allowCredentials: allowCredentials })), (userVerification && { userVerification: userVerification })), (rpId && { rpId: rpId })); | ||
} | ||
exports.parseWebAuthnAuthenticateText = parseWebAuthnAuthenticateText; | ||
//# sourceMappingURL=script-parser.js.map |
@@ -47,5 +47,4 @@ import Auth from './auth'; | ||
import Deferred from './util/deferred'; | ||
import nonce from './util/nonce'; | ||
import PKCE from './util/pkce'; | ||
import LocalStorage from './util/storage'; | ||
export { defaultMessageCreator, nonce, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackContainer, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FREvent, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUI, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, Listener, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackContainer, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, Dispatcher, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FREvent, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUI, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, Listener, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; |
@@ -7,3 +7,3 @@ "use strict"; | ||
* | ||
* Copyright (c) 2020 ForgeRock. All rights reserved. | ||
* Copyright (c) 2020-2021 ForgeRock. All rights reserved. | ||
* This software may be modified and distributed under the terms | ||
@@ -35,3 +35,3 @@ * of the MIT license. See the LICENSE file for details. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.WebAuthnStepType = exports.WebAuthnOutcome = exports.ValidatedCreateUsernameCallback = exports.ValidatedCreatePasswordCallback = exports.UserManager = exports.TokenStorage = exports.TokenManager = exports.TextOutputCallback = exports.TermsAndConditionsCallback = exports.SuspendedTextOutputCallback = exports.StepType = exports.SessionManager = exports.SelectIdPCallback = exports.ResponseType = exports.RedirectCallback = exports.ReCaptchaCallback = exports.PollingWaitCallback = exports.PolicyKey = exports.PKCE = exports.PasswordCallback = exports.OAuth2Client = exports.NameCallback = exports.MetadataCallback = exports.LocalStorage = exports.KbaCreateCallback = exports.HttpClient = exports.HiddenValueCallback = exports.FRWebAuthn = exports.FRUser = exports.FRStep = exports.FRRecoveryCodes = exports.FRPolicy = exports.FRLoginSuccess = exports.FRLoginFailure = exports.FRDevice = exports.FRCallback = exports.FRAuth = exports.ErrorCode = exports.Dispatcher = exports.DeviceProfileCallback = exports.Deferred = exports.ConfirmationCallback = exports.Config = exports.ChoiceCallback = exports.CallbackType = exports.Auth = exports.AttributeInputCallback = exports.nonce = exports.defaultMessageCreator = void 0; | ||
exports.WebAuthnStepType = exports.WebAuthnOutcome = exports.ValidatedCreateUsernameCallback = exports.ValidatedCreatePasswordCallback = exports.UserManager = exports.TokenStorage = exports.TokenManager = exports.TextOutputCallback = exports.TermsAndConditionsCallback = exports.SuspendedTextOutputCallback = exports.StepType = exports.SessionManager = exports.SelectIdPCallback = exports.ResponseType = exports.RedirectCallback = exports.ReCaptchaCallback = exports.PollingWaitCallback = exports.PolicyKey = exports.PKCE = exports.PasswordCallback = exports.OAuth2Client = exports.NameCallback = exports.MetadataCallback = exports.LocalStorage = exports.KbaCreateCallback = exports.HttpClient = exports.HiddenValueCallback = exports.FRWebAuthn = exports.FRUser = exports.FRStep = exports.FRRecoveryCodes = exports.FRPolicy = exports.FRLoginSuccess = exports.FRLoginFailure = exports.FRDevice = exports.FRCallback = exports.FRAuth = exports.ErrorCode = exports.Dispatcher = exports.DeviceProfileCallback = exports.Deferred = exports.ConfirmationCallback = exports.Config = exports.ChoiceCallback = exports.CallbackType = exports.Auth = exports.AttributeInputCallback = exports.defaultMessageCreator = void 0; | ||
var auth_1 = __importDefault(require("./auth")); | ||
@@ -126,4 +126,2 @@ exports.Auth = auth_1.default; | ||
exports.Deferred = deferred_1.default; | ||
var nonce_1 = __importDefault(require("./util/nonce")); | ||
exports.nonce = nonce_1.default; | ||
var pkce_1 = __importDefault(require("./util/pkce")); | ||
@@ -130,0 +128,0 @@ exports.PKCE = pkce_1.default; |
@@ -17,8 +17,10 @@ import { ConfigOptions } from '../config/index'; | ||
/** | ||
* DEPRECATED | ||
* Calls the authorize URL with an iframe. If successful, | ||
* it returns the callback URL with authentication code, | ||
* optionally using PKCE. | ||
* Method renamed in v3. | ||
* Original Name: getAuthorizeUrl | ||
* New Name: getAuthCodeByIframe | ||
*/ | ||
static getAuthorizeUrl(options: GetAuthorizationUrlOptions): Promise<string>; | ||
static getAuthCodeByIframe(options: GetAuthorizationUrlOptions): Promise<string>; | ||
/** | ||
@@ -25,0 +27,0 @@ * Exchanges an authorization code for OAuth tokens. |
@@ -7,3 +7,3 @@ "use strict"; | ||
* | ||
* Copyright (c) 2020 ForgeRock. All rights reserved. | ||
* Copyright (c) 2020-2021 ForgeRock. All rights reserved. | ||
* This software may be modified and distributed under the terms | ||
@@ -119,8 +119,10 @@ * of the MIT license. See the LICENSE file for details. | ||
/** | ||
* DEPRECATED | ||
* Calls the authorize URL with an iframe. If successful, | ||
* it returns the callback URL with authentication code, | ||
* optionally using PKCE. | ||
* Method renamed in v3. | ||
* Original Name: getAuthorizeUrl | ||
* New Name: getAuthCodeByIframe | ||
*/ | ||
OAuth2Client.getAuthorizeUrl = function (options) { | ||
OAuth2Client.getAuthCodeByIframe = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -131,5 +133,3 @@ var url, serverConfig; | ||
switch (_a.label) { | ||
case 0: | ||
console.warn('Deprecation warning: this `getAuthorizeUrl` method will be renamed in v3.'); | ||
return [4 /*yield*/, this.createAuthorizeUrl(options)]; | ||
case 0: return [4 /*yield*/, this.createAuthorizeUrl(options)]; | ||
case 1: | ||
@@ -136,0 +136,0 @@ url = _a.sent(); |
@@ -7,3 +7,3 @@ "use strict"; | ||
* | ||
* Copyright (c) 2020 ForgeRock. All rights reserved. | ||
* Copyright (c) 2020-2021 ForgeRock. All rights reserved. | ||
* This software may be modified and distributed under the terms | ||
@@ -194,3 +194,3 @@ * of the MIT license. See the LICENSE file for details. | ||
_e = URL.bind; | ||
return [4 /*yield*/, oauth2_client_1.default.getAuthorizeUrl(authorizeUrlOptions)]; | ||
return [4 /*yield*/, oauth2_client_1.default.getAuthCodeByIframe(authorizeUrlOptions)]; | ||
case 14: | ||
@@ -197,0 +197,0 @@ // To support legacy browsers, iframe works best with short timeout |
@@ -7,3 +7,3 @@ "use strict"; | ||
* | ||
* Copyright (c) 2020 ForgeRock. All rights reserved. | ||
* Copyright (c) 2020-2021 ForgeRock. All rights reserved. | ||
* This software may be modified and distributed under the terms | ||
@@ -91,5 +91,5 @@ * of the MIT license. See the LICENSE file for details. | ||
return [2 /*return*/, _b.sent()]; | ||
case 8: return [4 /*yield*/, indexed_db_1.default.get(clientId)]; | ||
case 8: return [4 /*yield*/, local_storage_1.default.get(clientId)]; | ||
case 9: | ||
// if tokenStore is undefined, default to previous behavior | ||
// if tokenStore is undefined, default to localStorage | ||
return [2 /*return*/, _b.sent()]; | ||
@@ -127,5 +127,5 @@ } | ||
return [2 /*return*/, _b.sent()]; | ||
case 8: return [4 /*yield*/, indexed_db_1.default.set(clientId, tokens)]; | ||
case 8: return [4 /*yield*/, local_storage_1.default.set(clientId, tokens)]; | ||
case 9: | ||
// if tokenStore is undefined, default to previous behavior | ||
// if tokenStore is undefined, default to localStorage | ||
return [2 /*return*/, _b.sent()]; | ||
@@ -163,5 +163,5 @@ } | ||
return [2 /*return*/, _b.sent()]; | ||
case 8: return [4 /*yield*/, indexed_db_1.default.remove(clientId)]; | ||
case 8: return [4 /*yield*/, local_storage_1.default.remove(clientId)]; | ||
case 9: | ||
// if tokenStore is undefined, default to previous behavior | ||
// if tokenStore is undefined, default to localStorage | ||
return [2 /*return*/, _b.sent()]; | ||
@@ -168,0 +168,0 @@ } |
@@ -13,3 +13,3 @@ /** | ||
*/ | ||
static createVerifier(num?: number): string; | ||
static createVerifier(): string; | ||
/** | ||
@@ -16,0 +16,0 @@ * Creates a SHA-256 hash of the verifier. |
@@ -7,3 +7,3 @@ "use strict"; | ||
* | ||
* Copyright (c) 2020 ForgeRock. All rights reserved. | ||
* Copyright (c) 2020-2021 ForgeRock. All rights reserved. | ||
* This software may be modified and distributed under the terms | ||
@@ -65,7 +65,4 @@ * of the MIT license. See the LICENSE file for details. | ||
*/ | ||
PKCE.createVerifier = function (num) { | ||
if (num) { | ||
console.warn('Deprecation warning: the parameter for `createVerifier` will be removed in v3'); | ||
} | ||
return this.createRandomString(num || 32); | ||
PKCE.createVerifier = function () { | ||
return this.createRandomString(32); | ||
}; | ||
@@ -72,0 +69,0 @@ /** |
{ | ||
"name": "@forgerock/javascript-sdk", | ||
"version": "3.0.0-beta1", | ||
"version": "3.0.0", | ||
"description": "ForgeRock JavaScript SDK", | ||
@@ -19,3 +19,2 @@ "main": "./lib/", | ||
"docs": "typedoc", | ||
"docs:watch": "watch \"npm run docs\" ./src", | ||
"lint": "eslint --ignore-path .gitignore \"**/*.ts\" --fix", | ||
@@ -38,3 +37,3 @@ "prepublishOnly": "npm run clean:all && npm i && npm run build && npm t", | ||
"pre-commit": "tsc && npm run lint", | ||
"pre-push": "npm run test:unit && npm run test:integration" | ||
"pre-push": "npm run test:unit && npm run test:integration && npm run build && npm run test:e2e" | ||
} | ||
@@ -58,5 +57,5 @@ }, | ||
"cookie-parser": "^1.4.4", | ||
"copy-webpack-plugin": "^9.0.0", | ||
"copyfiles": "^2.1.1", | ||
"cors": "^2.8.5", | ||
"cpy-cli": "^3.1.1", | ||
"eslint": "^7.8.1", | ||
@@ -66,7 +65,6 @@ "eslint-config-prettier": "^6.4.0", | ||
"express": "^4.17.1", | ||
"fake-indexeddb": "^3.0.0", | ||
"husky": "^4.2.5", | ||
"jest": "^26.0.1", | ||
"jest": "^26.6.3", | ||
"jest-canvas-mock": "^2.2.0", | ||
"jest-dev-server": "^4.3.0", | ||
"jest-dev-server": "^5.0.3", | ||
"jest-environment-jsdom": "^26.0.1", | ||
@@ -81,3 +79,2 @@ "jest-junit": "^12.0.0", | ||
"ts-loader": "^8.0.17", | ||
"tsconfig-paths-webpack-plugin": "^3.2.0", | ||
"typedoc": "^0.17.7", | ||
@@ -87,6 +84,5 @@ "typescript": "^4.0.0", | ||
"uuid": "^8.3.0", | ||
"watch": "^1.0.2", | ||
"webpack": "^5.24.4", | ||
"webpack-cli": "^4.5.0" | ||
"webpack": "^5.40.0", | ||
"webpack-cli": "^4.7.2" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
31
0
1535460
540
20642