Step 4. Configure the widget
The Advanced Identity Cloud/PingAM Login Widget needs the URL of your server’s .well-known/openid-configuration endpoint. If you use OAuth/OIDC tokens, user info, or logout, it also needs an OIDC client configuration.
To provide these settings, import and await the async configure() function:
// Import the modules
import Widget, { configure } from '@forgerock/login-widget';
// configure() is async, so await it before calling any other Widget API
await configure({
// REQUIRED; the well-known URL, shared by the journey and OIDC clients
serverConfig: {
wellknown: 'https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/root/realms/alpha/.well-known/openid-configuration',
},
// REQUIRED if you use OAuth/OIDC tokens, user info, or logout
oidcClient: {
clientId: 'sdkPublicClient',
redirectUri: `${window.location.origin}/callback`,
// OPTIONAL; defaults to 'openid'
scope: 'openid profile email address',
},
});
|
Call The Advanced Identity Cloud/PingAM Login Widget constructs its internal clients during this call. Any Widget API, including |
Server
| Property | Description |
|---|---|
|
Required.
The full URL to your server’s The Advanced Identity Cloud/PingAM Login Widget uses this single URL to discover the endpoints for both the journey client and the OIDC client. The realm is encoded in the path. PingOne Advanced Identity Cloud example:
Self-hosted example:
|
Logging, middleware, and storage
| Property | Description |
|---|---|
|
Optional. Forwarded to both the journey and OIDC clients.
|
|
Optional. An array of request middleware functions, forwarded to both Journey and OIDC clients. Each function has the shape |
|
Optional. Configures where the OIDC client persists tokens. Forwarded to the OIDC client only. Accepts either:
|
OAuth 2.0
The oidcClient object is required if you use OAuth/OIDC tokens, user info, or logout.
| Property | Description | ||
|---|---|---|---|
|
Required within |
||
|
Required within
For example, |
||
|
Optional within For example, If not provided, the default value is |
||
|
Optional within |
||
|
Optional within |
||
|
Optional within |
||
|
Optional within |
||
|
Optional within |
Optional configuration objects
| Property | Description |
|---|---|
|
Configure CAPTCHA rendering. Currently supports Refer to Implement a CAPTCHA. |
|
Override the widget’s default text content, or provide localized strings. Refer to Localizing the widget. |
|
Map HREF values rendered by the widget to journeys so that clicking a link starts a journey instead of navigating. Refer to Journeys configuration options. |
|
Set the full canonical URL to your terms and conditions page. Refer to Links configuration options. |
|
Configure the widget’s visual appearance, including labels, logos, stage icons, password visibility, and theme colors and fonts. Refer to Style configuration options. |
Next
Next, you can Step 5. Instantiate the widget.