ForgeRock Developer Experience

Configure CORS

Applies to:

  • ForgeRock SDK for Android

  • ForgeRock SDK for iOS

  • ForgeRock SDK for JavaScript

Cross-origin resource sharing (CORS) lets user agents make cross-domain server requests. In Identity Cloud, you can configure CORS to allow browsers from trusted domains to access Identity Cloud protected resources. For example, you might want a custom web application running on your own domain to get an end-user’s profile information using the Identity Cloud REST API.

By default, CORS is configured to let the ForgeRock SDKs access Identity Cloud.

When trying out the ForgeRock SDKs you run sample applications locally using a DNS alias, such as the preconfigured domain sdkapp.example.com. You might need to add accepted origin domains to the configuration, depending on the DNS alias you give to your apps.

To update the CORS configuration in Identity Cloud, follow these steps:

  1. Log in to your Identity Cloud tenant.

  2. At the top right of the screen, click your name.

  3. Select Tenant settings > Global Settings.

  4. Click Cross-Origin Resource Sharing (CORS).

  5. Click ForgeRockSDK.

  6. Add any DNS aliases you use for your domains to the Accepted Origins property.

    This documentation assumes the following configuration:

    Property Values

    Accepted Origins

    https://sdkapp.example.com:8443

    https://angular.example.com:8443

    https://react.example.com:8443

    Accepted Methods

    GET

    POST

    Accepted Headers

    accept-api-version

    authorization

    content-type

    if-match

    iPlanetDirectoryPro

    x-requested-with

    Exposed Headers

    authorization

    content-type

    x-requested-with

    Enable Caching

    True

    Max Age

    600

    Allow Credentials

    True

  7. Click Save CORS Configuration.

Copyright © 2010-2023 ForgeRock, all rights reserved.