Oauth2 for LXM usage
1 min read
Unique offers the possibility to use oauth2 as authentication for LXM calls. Means supporting the configuration of an clientId, an clientSecret, an endpoint and optionally a scope value to first call this endpoint in order to receive a valid token for the request to the LXM.
This token endpoint needs to provide an access_token and an expires_in (seconds) attribute as response. Based on this expires_in and the clientId Unique caches this token in the application memory to not request a new token for the same clientId again for every LXM request. 30 seconds before the token expires or when its already expired Unique will request a new token.
Configuration for LXM calls from node-chat application:
Environment variable |
|
Description | Its an JSON array of objects, which contain the following string attributes:
The |
Example:
CHAT_LLM_OAUTH_CONFIGURATION='[{
"llmEndpoint": "{SAME_ENDPOINT_AS_IN_ENDPOINTS_JSON}",
"clientId": "myClientId",
"clientSecret": "myClientSecret",
"authEndpoint": "https://www.oauth.testing/token",
"scope": "custom-scope"
}]'Also External / Custom LXMs can use the oauth2 authentication. Please check the following documentation.
Configuration for embedding calls from node-ingestion:
Environment variable |
|
Example:
INGESTION_EMBEDDING_OAUTH_CLIENT_ID="My ClientId"
INGESTION_EMBEDDING_OAUTH_CLIENT_SECRET="My ClientSecret"
INGESTION_EMBEDDING_OAUTH_ENDPOINT="https://www.oauth.testing/token"
INGESTION_EMBEDDING_OAUTH_SCOPE="custom-scope"Configuration for MS Document Intelligence calls from node-ingestion-worker
Environment variable |
|
Example:
INGESTION_WORKER_MS_DI_OAUTH_CLIENT_ID="My ClientId"
INGESTION_WORKER_MS_DI_OAUTH_CLIENT_SECRET="My ClientSecret"
INGESTION_WORKER_MS_DI_OAUTH_ENDPOINT="https://www.oauth.testing/token"
INGESTION_WORKER_MS_DI_OAUTH_SCOPE="custom-scope"