Breaking changes
This page summarizes breaking changes to the Advanced Identity Cloud/PingAM Login Widget, and how to migrate an existing integration past each one.
Advanced Identity Cloud/PingAM Login Widget 2.0
Advanced Identity Cloud/PingAM Login Widget 2.0 introduces breaking changes to configuration, module dependencies, and the public API. This section summarizes what changed, why it changed, and how to migrate an existing 1.x integration.
Summary of changes
-
Configuration is now driven by a single async
configure()function; the synchronousconfiguration()+.set()pattern is removed. -
Endpoint discovery is now driven by a single top-level
wellknownURL that is shared by the journey and OIDC clients. -
The nested
forgerockconfig object is replaced by a flat, top-level shape with anoidcClientsub-object. -
The
requestexport, an alias to the legacyHttpClient.request, is removed. -
Underlying dependencies have moved: OAuth/OIDC is now backed by
@forgerock/oidc-client, PingOne Protect is backed by@forgerock/protect, and@forgerock/javascript-sdkis no longer a dependency of the widget.
Migration checklist
-
Rename the
configurationimport toconfigure. -
Replace calls to
configuration()and.set()with a singleawait configure({…}). -
Move endpoint discovery to a top-level
wellknownURL. RemoveserverConfig,baseUrl,timeout,realmPath,tree, and anyserverConfig.pathsoverrides. -
Wrap
clientId,redirectUri, andscopein a newoidcClientsub-object. Add theoidcClientsub-object if you use OAuth/OIDC tokens, user info, or logout. -
Remove any calls to the
requestexport. Fetch tokens fromuser.tokens().get()and callfetchyourself. -
Remove any of the following that appear in your configuration. They have no replacement:
oauthThreshold,tokenStore,prefix,logLevel,logger,platformHeader. -
awaitthe returned promise before calling any other Widget API.journey().start(),user.info().get(), anduser.tokens().get()all fail if called beforeconfigure()resolves.
Before and after
Configuration
import Widget, { configuration } from '@forgerock/login-widget';
const myConfig = configuration();
myConfig.set({
forgerock: {
serverConfig: {
baseUrl: 'https://openam-forgerock-sdks.forgeblocks.com/am/',
timeout: 3000,
},
clientId: '{edit_client_public}',
realmPath: 'alpha',
redirectUri: window.location.href,
scope: '{edit_scopes}',
},
});
import '@forgerock/login-widget/widget.css';
import Widget, { configure } from '@forgerock/login-widget';
// configure() is async, so await it before any other Widget API
await configure({
wellknown: 'https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/root/realms/alpha/.well-known/openid-configuration',
oidcClient: {
clientId: 'sdkPublicClient',
redirectUri: `${window.location.origin}/callback`,
scope: 'openid profile email address',
},
});
Starting a journey after configuration
import Widget, { configuration, journey } from '@forgerock/login-widget';
const myConfig = configuration();
myConfig.set({ forgerock: { /* ... */ } });
new Widget({ target: document.getElementById('widget-root') });
const journeyEvents = journey();
journeyEvents.start();
import Widget, { configure, journey } from '@forgerock/login-widget';
await configure({
wellknown: 'https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/root/realms/alpha/.well-known/openid-configuration',
oidcClient: { /* ... */ },
});
new Widget({ target: document.getElementById('widget-root') });
journey().start();
Calling a protected resource
import { request } from '@forgerock/login-widget';
const response = await request({
init: { method: 'GET' },
url: 'https://protected.resource.com',
});
import { user } from '@forgerock/login-widget';
const { response: tokens } = await user.tokens().get();
const response = await fetch('https://protected.resource.com', {
method: 'GET',
headers: {
Authorization: `Bearer ${tokens.accessToken}`,
},
});
|
The legacy Neither behavior is provided by the Advanced Identity Cloud/PingAM Login Widget 2.0 or If your app depends on these, you must implement them at the consumer level. |
Custom endpoint paths
The following properties are all removed in 2.0. Every endpoint is now discovered from wellknown.
-
serverConfig.paths.authenticate -
serverConfig.paths.authorize -
serverConfig.paths.accessToken -
serverConfig.paths.revoke -
serverConfig.paths.userInfo -
serverConfig.paths.sessions -
serverConfig.paths.endSession
If your deployment does not expose a standard .well-known/openid-configuration document, you must add one before upgrading to 2.0.
Removed with no replacement
The following configuration properties existed in 1.x and are removed in 2.0. None have direct replacements in the widget configuration.
| Property | Notes |
|---|---|
|
Use |
|
Endpoints are discovered from |
|
All seven per-endpoint overrides are gone. |
|
The realm is encoded in the The |
|
Managed internally by |
|
Token storage is managed internally by |
|
Not currently configurable in the widget. |
|
Not currently configurable in the widget. |
|
Initialize PingOne Signals separately via |
Related pages
- Tutorial
-
Updated for 2.0.
- API reference
-
Updated for 2.0.
- Login Widget changelog
-
The Advanced Identity Cloud/PingAM Login Widget 2.0 release entry.