Skip to content

API Credentials

Paul Saunders edited this page Sep 20, 2022 · 2 revisions

API Credentials

All authenticated calls to the LUSID API require an OpenID Connect ID token which is issued from a your token issuer url. The details of these can be found on your LUSID portal under "Applications" within the "Identity and Access Management" section.

The API details can be supplied to the SDK as environment variables or via a file. The SDK will first check for the existence of the environment variables and if not found, will then check for secrets.json file.

Environment Variables

The SDK configuration can be supplied by setting the following environment variables:

Name Value
FBN_LUSID_API_URL Your LUSID API url, this is the value for 'API Url' in your portal
FBN_TOKEN_URL Okta endpoint to generate the authentication token, this is the value for 'Token Url' in your portal
FBN_CLIENT_ID OpenID Connect Client ID, this is the value for 'Client Id' in your portal
FBN_CLIENT_SECRET OpenID Connect Client Secret, this is the value for 'Secret' in your portal
FBN_USERNAME The username of the account being used for accessing the API
FBN_PASSWORD The password of the account being used for accessing the API
FBN_APP_NAME An optional identifier for your application

OR

Name Value
FBN_LUSID_API_URL Your LUSID API url, this is the value for 'API Url' in your portal
FBN_ACCESS_TOKEN A personal access token; see Section 3 of this KB article
FBN_APP_NAME An optional identifier for your application

Configuration File

To supply the SDK configuration via a file, create a secrets.json with the structure below and populated with the appropriate values.

{
  "api" : {
    "apiUrl": "",
    "tokenUrl": "",
    "clientId": "",
    "clientSecret": "",
    "username": "",
    "password": "",
    "applicationName": ""    
  }
}
Key Description
apiUrl Your LUSID API url, this is the value for 'API Url' in your portal
tokenUrl Okta endpoint to generate the authentication token, this is the value for 'Token Url' in your portal
clientId OpenID Connect Client ID, this is the value for 'Client Id' in your portal
clientSecret OpenID Connect Client Secret, this is the value for 'Secret' in your portal
username The username of the account being used for accessing the API
password The password of the account being used for accessing the API
applicationName An optional identifier for your application

The path to the secrets.json is then passed to LusidApiFactoryBuilder.Build() which returns a configured LUSID API client. For examples on how to do this refer to the tutorials.

Clone this wiki locally