Configure Okta as the authentication provider - Intergraph Smart Instrumentation - 2.3.16 - Installation & Upgrade - Hexagon

Intergraph Smart Instrumentation Web API Installation and Configuration Guide

ft:locale
en-US
Product
Intergraph Smart Instrumentation
Subproduct
Web API
Search by Category
Installation & Upgrade
Smart Instrumentation Web Version
2.3

Okta uses OAuth protocol to issue tokens that control access to web APIs. To request these tokens, you must first register your application with an Okta authorization server. Follow the steps below to set up an Okta authorization server:

Create an Okta account

To get started, sign up for an Okta account or sign in using an administrator account.

Create a new user

  1. In the Okta Admin Console, go to Directory > People.

  2. Select Add Person to manually add users or import them from a directory.

  3. Assign the user to an existing group. If necessary, create a new group.

Assign users to a group

  1. In the Okta Admin Console, go to Directory > Groups.

    SHARED Tip To create a new group, select Add Group and enter the details.

  2. Select the group > Manage People and then choose the users.

  3. Select Save.

Create an application

Okta refers to clients as applications.

  1. In the Okta Admin Console, go to Applications > Applications.

  2. Select Create App Integration.

  3. Select OIDC - OpenID Connect as the Sign-in method.

  4. For Application type, select Single-Page Application, and then select Next.

  5. Enter the details as follows:

    Setting

    Description

    App integration name

    Name of the client application. Enter the name in this format: estateshortcode-appid-sitename-authflow

    Example: siv3-si-app-pkce

    The application name must consist of UTF-8 encoded characters.

    Grant type

    Okta authorizes your application requests with these OAuth grant types. Select Authorization Code (default) and Refresh Token.

    Sign-in redirect URIs

    URIs of the server where your application is hosted. Okta sends the authentication response and ID token for the sign-in request to these URIs.

    Example:

    http://localhost:8080/callback

    https://sandbox.intergraphsmartcloud.com

    Sign-out redirect URIs

    After your application contacts Okta to close the user session, Okta redirects the user to one of these URIs.

    Example:

    http://localhost:8080/callback

    https://sandbox.intergraphsmartcloud.com

    Assignments

    Specifies which users or groups can access the application. Select Limit access to selected groups and type the group name.

  6. Select Save.

  7. After saving, copy the Client ID and save it for future use. Also, ensure the Client authentication is set to PKCE.

Generate audience GUID for authorization server

The audience GUID is required when you create a custom authorization server. The audience represents the intended recipient of tokens issued by the server and is included in the aud claim of OAuth 2.0 and OpenID Connect tokens. This ensures that tokens are only accepted by the correct resource or API.

Okta requires the Audience value to be a Globally Unique Identifier (GUID) in uppercase format. This GUID acts as a secure identifier for your resource server.

  1. Generate a GUID. For example, go to https://www.guidgenerator.com and generate a GUID.

    SHARED Tip You can use online GUID or UUID generators, command-line tools, or any programming languages to generate the GUID.

  2. Ensure the GUID is in uppercase. Convert it if necessary. For example:

    Lowercase: 123e4567-e89b-12d3-a456-426614174000

    Uppercase: 123E4567-E89B-12D3-A456-426614174000

  3. Save the GUID to use it later when adding the authorization server.

Add an authorization server

  1. In the Okta Admin Console, go to Security > API.

  2. On the Authorization Servers tab, select Add Authorization Server and enter the details.

  3. In the Audience box, paste the GUID you generated, and then select Save.

  4. In the Settings tab, change the Issuer to Custom URL and enter the authorization server URL in the format - https://[yourOktaDomain]/oauth2/[authorizationServerId]. For example, https://sandbox.intergraphsmartcloud.com/oauth2/aus3u65bQjox7

Create API access scopes

  1. In the Okta Admin Console, go to Security > API and select the authorization server you created.

  2. On the Authorization Server details page, select the Scopes tab and then select Add Scope.

  3. Create the audience GUID scope as follows:

    Setting

    Value

    Name

    Enter the audience GUID that you generated.

    Display phrase

    Enter Smart API Service.

    Description

    Enter a description. For example, allows you to access resources from Smart APIs.

    User Consent

    Select Implicit.

    Metadata

    Select Include in public metadata.

  4. Select Create.

  5. Create the ingr.api scope as follows:

    Setting

    Value

    Name

    Type ingr.api

    Display phrase

    Enter a short description. For example, access resources.

    Description

    Enter a description. For example, allows you to access resources from Smart APIs.

    User Consent

    Select Implicit.

    Metadata

    Select Include in public metadata.

  6. Select Create.

Create API access claims

  1. On the Authorization Server details page, select the Claims tab, and then select Add Claim.

  2. Create the ingr.session_id claim as follows:

    Setting

    Value

    Name

    Type ingr.session_id

    Include in token type

    Select Access Token.

    Value type

    Select Expression.

    Value

    Type Time.now("")

    Include in

    Select Any scope.

  3. Select Create Claim.

  4. Create another claim as follows:

    Setting

    Value

    Name

    Type a name.

    Include in token type

    Select Access Token.

    Value type

    Select Expression.

    Value

    Type String.join(" ", user.firstName, user.lastName)

    Include in

    Select Any scope.

  5. Select Create Claim.

  6. Locate the sub claim. It is usually listed as a system claim.

  7. Modify the following values in the sub claim:

    Setting

    Value

    Value type

    Select Expression.

    Value

    Enter(appuser != null) ? (!Arrays.isEmpty(user.estateUsers)) ?

    String.substringBefore("SEM"+String.substringBefore(String.substringAfter(Arrays.to CsvString(user.estateUsers)+",", "SEM"),","),"@") : String.substringBefore(user.login,"@") : ((app.profile.Username != null) ?

    app.profile.Username: app.clientId)

Set up API access policies

  1. On the Authorization Server details page, select the Access Policies tab, and then select Add Policy.

  2. Create the policy as follows:

    Setting

    Value

    Name

    Enter a name. For example, Smart Instrumentation.

    Description

    Enter a description. For example, allows to share resources between the client and API.

    Assign to

    Select The following clients:, and then type the client application name that you created. For example, siv3-si-app-pkce.

  3. Select Create Policy.

  4. Select the policy you just created, and then select Add Rule.

  5. Define which grant types can request tokens and set the token lifetime, as follows:

    Setting

    Value

    Rule Name

    Enter a name. For example, Smart Instrumentation.

    IF Grant type is

    Select Authorization Code.

    AND User is

    Select The following clients:, and then type the client application name that you created. For example, siv3-si-app-pkce

    AND Scopes requested

    Select Any scopes.

    THEN Access token lifetime is

    Set to 1 Days.

    AND Refresh token lifetime is

    Select Unlimited.

    but will expire if not used every

    7 Days

  6. Select Create Rule.

Test the authorization server configuration

  1. On the Authorization Server details page, select the Token Preview tab.

  2. In the Request Properties section, enter the following details:

    Setting

    Value

    Oauth/OIDC Client

    Select the client you created. For example, siv3-si-app-pkce.

    Grant type

    Select Authorization Code.

    User

    Select the logged in user or the user assigned to this client.

    Scopes

    Enter the following scope names: [audience GUID], ingr.api, openid, profile

  3. Select Preview Token to see the resulting tokens.