Obtaining Client Credentials - Intergraph Smart Instrumentation - Help - Intergraph

Intergraph Smart Instrumentation Smart API Tutorial

Intergraph Smart Instrumentation

All Smart Instrumentation Smart APIs are secured behind the OAuth2 protocol. You need to be authenticated to access the API and in addition, the Smart Instrumentation web services need to be authorized to be accessible by your client (your browser). This authentication is granted by the Smart API Manager (SAM).

In addition, SAM provides the following:

  • Register Smart APIs

  • Authorize a group to access a Smart API.

  • Create and manage groups. For example, adding identities and specifying claims.

  • Register Smart Clients. A Smart Client must be registered to call Smart APIs

Once your client is authorized and authenticated, you are ready to call the Smart Instrumentation Smart API.

To gain authorization, you must get someone in your organization who has Administrator permissions to provide the credentials for you.

Generate a token to allow secure access to SAM

The token is generated by the SAM server. After an inactive period, your initial token expires and might need to be updated using the POST Get Token request. For this tutorial, we have included with the predefined queries a POST request that generates a new token from the SAM server.

To generate a token, do the following:

  1. In the Collections tab, click the first request 01.01 Get Token.

  2. Move the cursor over the variable {{samServerUri}} in the address bar. A tool tip displays the server name.

  3. In the tool tip, verify that the environment variable is populated with your SAM server address.

  4. Click .

    The response returns a string with a success status.

    Access tokens are set to expire periodically. When it does, your API requests will return an error code: "401 Token validation failed...".

When this happens, return to the Collections tab, click the Get Token query, and click .

The POST request that gets the token has a Test snippet that copies the received token to the selected Environment. The token is then used by the requests that you send. The Get Token POST request has also a set of keys and values in the Body of the request.