OCI Attributes to Obtain MS EI Access Tokens

This topic provides details of the new OCI attributes introduced to directly obtain Microsoft Entra ID access tokens.

The following new OCI attributes must be passed as key input client credentials through OCI client driver for Microsoft Entra ID access token acquisition.

Attribute Name Sample Value Description
OCI_ATTR_OAUTH2_TENANTID 0000000000-c000-0000-0000-0000ddac0000 MS EI Tenant ID
OCI_ATTR_OAUTH2_CLIENTID 0000000000-c000-0000-0000-0000ddac0000 Registered MS EI Application Client ID
OCI_ATTR_OAUTH2_CLIENTSECRET 0000000000c000000~0000-0000ddac0000 MS EI Application Client Secret
OCI_ATTR_OAUTH2_APPIDURI https://constco.onmicrosoft.com/0000000000c000000~0000-0000ddac0000 MS EI Application ID URI

Note:

New attributes are optional and only trigger the enhancement if all are present.

API Attributes

Attribute Setting Example

....

OCIAttrSet(sessionHandle, OCI_HTYPE_SESSION, tenantId, strlen(tenantId), OCI_ATTR_OAUTH2_TENANTID, errHandle);
OCIAttrSet(sessionHandle, OCI_HTYPE_SESSION, clientId, strlen(clientId), OCI_ATTR_OAUTH2_CLIENTID, errHandle);
OCIAttrSet(sessionHandle, OCI_HTYPE_SESSION, clientSecret, strlen(clientSecret), OCI_ATTR_OAUTH2_CLIENTSECRET, errHandle);
OCIAttrSet(sessionHandle, OCI_HTYPE_SESSION, appIdUri, strlen(appIdUri), OCI_ATTR_OAUTH2_APPIDURI, errHandle);

....