To use Smart API Manager (SAM) as the IdP for the API, you must update the following configuration files for the Smart Completions Smart API:
-
appsettings.json
-
sam.json
Some of the settings you simply need to verify, others you will have to add or change.
Update appsettings.json
-
Open the appsettings.json file.
-
Make sure the Hexagon.SmartAPI > Services section has the correct properties and values, such as UriPrefix, ServiceId, ServiceAudience, and ServiceSecret. For example:
Hexagon.SmartApi": {
"Services": [
{
"UriPrefix": "smartapi/v1",
"ServiceId": "<SAM_Server_Application_Id>",
"ServiceAudience": "<SAM_Server_Application_Id>",
"ServiceSecret": "<SAM_Server_Server_Secret>",
"InstanceName": "Windows-Instance"
},
{
"UriPrefix": "DataLake/v1",
"ServiceId": "<SAM_Server_Application_Id>"
}
],
}
-
In the OAuth section, update the Issuer property with the URL for your Smart API Manager instance. For example:
"OAuth": {"Issuer": "https://<SAM_ISSUER_URL>/oauth"}
Where SAM_ISSUER_URL is the server name and path to the oauth resource, for example:
https://samdev.acme.com/sam/oauth
Update sam.json
-
Open the sam.json configuration file, under the SC > Client path.
-
Update the TokenIssuers section as needed. For example:
{
"TokenIssuers": [
{
"TokenIssuerUri": "https://login.microsoftonline.com/<tenant-Id>/v2.0",
"Id": "<Client-Id>",
"Secret": "<Client-secret>",
"IsInternal": "false",
"Scope": ""
}
]
}
Where:
-
TokenIssuerUri - The Issuer URI provided by Smart API Manager during app registration.
-
ID - The Client ID provided by Smart API Manager.
-
Secret - The Client secret from Smart API Manager.
-
IsInternal - Must be set to false.
-
Scope - The Smart API Service ID from Smart API Manager.
-