Here you can the below information to configure Smart APIs by using OAuth 2.0 with Azure Active Directory (AD):
Prerequisites
-
Register an application (backend-app Smart API) in Azure AD to represent the API.
-
Register another application (client-app Mobile/Postman) in Azure AD to represent a client application that needs to call the API.
Once you register to a Smart API application:
-
Open Expose an API > Application ID URI and then click Set.
-
Click + icon to Add a Scope, and enter the required information.
-
Click Add Scope.
-
Get access to the Application ID, Audience API, and Scope API values.
Register to your mobile client application:
-
From the Sidebar navigation, go to Manage > API Permissions.
-
Click Add a Permission, and then select My APIs.
-
Select a user, and the click Add Permissions.
-
Click Authentication, and in the Mobile and Desktop Applications section, provide the callback URL information as auth://com.hexagon.SmartCompletions.
Configure your API and client details using Smart API
-
Open appsettings.json file from the Smart API application.
-
Update the service audience and service issuer values.
The service ID is the same as application ID of API.
Token Name |
Value |
Service Audience |
bd73a94c-05ea-4d0f-a5b5-495ab2f7b0d1 |
Service ID |
bd73a94c-05ea-4d0f-a5b5-495ab2f7b0d1 |
OAuth Issuer |
https://login.microsoftonline.com/1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f5a/v2.0 |
-
Update the client details in client.json file.
ID is application ID of client application registered in azure AD.
Token Name
Value
Token Issuer URI
https://login.microsoftonline.com/1b16ab3e-b8f6-4fe3-9f3e-2db7fe549f5a/v2.0
id
d8174708-6740-4993-91fd-515f520b73b3
You can now start using the Smart Completions Mobile application.