JavaScript SDK Troubleshooting

Last updated Jun 2, 2020

This article contains information on how to diagnose issues within the application, or with communication to the ForgeRock Identity Platform.

1 reader recommends this article


How do I troubleshoot possible CORS issues in AM?

See How do I troubleshoot issues with the CORS filter in AM/OpenAM (All versions)? on troubleshooting CORS issues in AM.

Why is nothing rendering when viewing a page that uses the ForgeRock SDK for JavaScript?

Check the following if the page is blank or the login fields do not display when using the JavaScript SDK:

  1. Confirm that there are no errors in the browser console.
  2. Confirm that calls to the /authenticate endpoint from your app are returning either 200 or 401.

  3. If you are using Internet Explorer 11, confirm that you have applied polyfills for both fetch and Promise.

Why can I get a session token, but not an access token?

Check the following if your app is able to obtain a session (SSO) token, but is unable to exchange it for an access token:

  1. Confirm that calls to the /authenticate endpoint from your app are returning 302 and that the location header contains a URL which includes a code query parameter.

    • If 400 is returned, check the HTML response body for a script block defining a pageData variable that describes the error.
    • If 200 is returned, check the following:

      • Ensure that the "Implied consent" property is enabled in the OAuth 2.0 client profile in AM.

        Without the property, AM returns a page to ask the user to provide consent for the requested scopes, which the SDK is not expecting.

      • If using Chrome 80 or newer, the SameSite=Lax option is possibly being applied, and the session cookie is not being written even though authentication is successful.

        Without the cookie, AM keeps redirecting to the login page.

Why do I get an error similar to "a mutation operation was attempted on a database that did not allow mutations"?

If you are using Firefox, this error message can occur if you are using the Private Window mode, which prevents the "IndexedDB" functionality the SDK requires from operating correctly.

For more information, see IndexedDB does not function in private browsing mode.

Why do I get an error similar to "Cannot read property 'digest' of undefined"?

If you are using a Chromium-based browser (including Google Chrome, Microsoft Edge, Opera and Amazon Silk), this error message can occur if you are not accessing the SDK application by using a "secure origin", for example you are using HTTP rather than HTTPS.

For testing purposes, you can use localhost, which Chromium-based browsers consider to be a secure origin. Be sure to configure your CORS filters accordingly.

For more information, see WebCrypto.

Copyright and TrademarksCopyright © 2020 ForgeRock, all rights reserved.