Get an access token using the Authorization Code with PKCE grant type - Intergraph Smart Completions - Intergraph Smart Completions 6.0 - Customization & Programming - Hexagon

Intergraph Smart Completions Smart API Programmer's Getting Started Guide

Language
English
Product
Intergraph Smart Completions
Search by Category
Customization & Programming
Smart Completions Version
6.0

This example shows how to get an access token for a Postman client application when using the Authorization Code with PKCE grant type.

Required information

  • The information supplied by the identity provider upon registering Power BI as a client application:

    • Token URL

    • Issuer URL

    • Authorization URL

    • Client ID

    • Client Secret (if required by your identity provider)

    • Scope

    • State (if required by your identity provider)

    • For the Smart Cloud environment, this information is supplied by the Smart Cloud support team when they respond to the request to register Postman as a client.

    • For other environments, you can get the Token, Issuer, and Authorization URLs from the configuration endpoint for your identity provider:

      <idp_hostname>/<idp_baseurl>/.well-known/openid-configuration

  • Smart Completions Smart API Base URL

Get the access token

  1. Create a Postman collection for accessing the web API and define a variable to hold the access token for the collection.

  2. Go to the Authorization section.

    Postman PKCE Authentication - Get Token

  3. For Type, select OAuth 2.0.

  4. Enter the name of the access token variable in the Token Name field.

  5. For Grant Type, select Authorization Code (With PKCE).

  6. For Callback URL, enter https://www.getpostman.com/oauth2/callback.

  7. For Code Challenge Method, select SHA-256.

  8. For Client Authentication, select Send client credentials in body.

  9. For the remaining fields, enter the information supplied by your identity provider.

    If the scope value was created by Intergraph Smart© Cloud Portal, you must remove the text ingr.api from the value. For example:

    • Scope created by Smart Cloud Portal: E5CD0128-899F-4001-9494-63BF79067346 ingr.api

    • Scope to use in the query: E5CD0128-899F-4001-9494-63BF79067346

  10. Click Get New Access Token.

  11. If required, sign in using your Smart Completions credentials.

    If the request succeeds, you receive an access token.

    Postman PKCE Authentication - Get Token 2

Copy the access token from the response

  1. Copy the access token from the response.

  2. Paste the access token into the CURRENT VALUE column for the access token variable you defined.

    Postman PKCE Authentication - Get Token 3

  3. Now, you can use the access token to request a resource.