To use a Smart Completions authentication server as the IdP for the API, you must update several configuration files for the Smart Completions Smart API:
-
appsettings.json
-
sam.json
-
web.config at the application root
-
web.config at the API root
Some settings you simply need to verify, others you 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": "",
"ServiceAudience": "",
"ServiceSecret": "",
"InstanceName": "Windows-Instance"
},
{
"UriPrefix": "DataLake/v1",
"ServiceId": ""
}
],
}
-
In the SCAuth section, update the Issuer and storeThumbprint properties with the information for your signed certificate. For example:
"SCAuth": {
"Issuer": "https://<BASE_URL>/api/Authentication.asmx",
"storeThumbprint": "<SELF-SIGNED-CERT_THUMBPRINT-VALUE>"
}
If the self-signed certificate does not exist, you must create it.
Update sam.json
-
Open the sam.json configuration file, under the SC > Client path.
-
In the TokenIssuers section, set the IsInternal property to true. For example:
{
"TokenIssuers": [
{
"TokenIssuerUri": "<BASE_URL>",
"Id": null,
"Secret": null,
"Scope": null,
"IsInternal": "true"
}
]
}
By default, IsInternal is set as false.
Update web.config at application root
-
Open the web.config file in the application's <root-directory> directory.
-
Add the appSettings properties, as follows:
<appSettings>
<add key="SCAuth:storeThumbprint" value="<SELF-SIGNED-CERT_THUMBPRINT-VALUE>"/>
</appSettings>
Update web.config at API root
-
Open the web.config file in the application's <root-directory>/API folder.
-
Add the appSettings properties, as follows:.
<appSettings>
<add key="SCAuth:storeThumbprint" value="<SELF-SIGNED-CERT_THUMBPRINT-VALUE>"/>
</appSettings>