This is documentation of an archived release.
For documentation on the current version, please check Knowledge Base.

Example: Enable Bentley IMS Login

The example below has an extra Sign In to 3DM Cloud (Bentley IMS) option available.



Preparations

1. SPA Client Registration

To get started, your application needs to be registered with the Bentley IMS to use the iTwin Platform APIs.
You can do so here : https://https://developer.bentley.com/register

Enter the following information :

  • Name: The name of your application
  • API Associations/Allowed Scopes: Leave empty for now
  • Application Type: SPA
  • Redirect URI: The URI of the callback document (see 2. Callback document).

After creating the client, we will now manage it from a different place.
Navigate to https://imsoidcui.bentley.com and select “Manage Applications”.

Here, edit the client you just created using the “Edit” Action :

Update the following elements :

  • Scopes : Press the “Add +” button to add the following scopes :
    • orbit-3dm
    • realitydata:read
    • rbac-service
  • CORS Origin URLs: Press the “Add +” button to add the list of domains where your application is hosted.

2. Callback document

A callback document must be made available. The URL to this document will be used to hand off the authorization code to the application.

SDK Initialisation

To enable the option to login in using Bentley IMS, you need to provide these options at startup :

var options= new AMap();
options.set(Constants.STARTUP_BENTLEY_IMS_ENABLE,true);
options.set(Constants.STARTUP_BENTLEY_IMS_CLIENT_ID,"<your-client-id>");
options.set(Constants.STARTUP_BENTLEY_IMS_REDIRECT_URL,"<your-callback-handler-url>");
let viewer = new SDKViewer("app name",divElement,options);
 
Last modified:: 2023/01/09 12:48