8.5 Validate the OCI IAM Configuration
Before you configure the database, confirm that the application registrations, scopes, custom claim rule, and user assignments you configured in OCI IAM are working as expected.
Validation consists of obtaining two tokens from OCI IAM and inspecting their
claims:
- Database-access token: Issued to the application through the client credentials grant.
- End-user token: Issued to the test user through the authorization code grant.
To complete this task, you need the following:
- Command-line environment with
curlinstalled. - Client ID and client secret for the database registration, identity domain URL, and database-access scope. See Register the Database in OCI IAM.
- Client ID and client secret for the application, application scope, and redirect URL. See Register the Application in OCI IAM.
- User name and password of a test user assigned to at least one group. See Create Users and Assign Groups in OCI IAM.
- JWT debugger, such as a command-line JWT decoder or a trusted web-based debugger, for inspecting token claims.
Alternative: Obtain an end-user token using the Resource Owner Password Credentials grant
For non-production validation, you can skip the browser sign-in by requesting an end-user token through the Resource Owner Password Credentials (ROPC) grant. This approach is suitable only for automated testing in non-production environments.
To use the ROPC grant, first select the Resource owner grant type
on the application registration in Register the Application in OCI IAM, then
run:
curl -i \
-H "Authorization: Basic <encoded_app_credentials>" \
-H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" \
--request POST https://<domain_url>/oauth2/v1/token \
-d "grant_type=password&username=<username>&password=<password>&scope=<application_scope>"
The following list describes each placeholder:
<encoded_app_credentials>: Same Base64-encoded credentials used in the database-access token request.<domain_url>: Same identity domain URL used in the database-access token request.<username>and<password>: Credentials of the test user created in Create Users and Assign Groups in OCI IAM.<application_scope>: Same application scope used in the authorization code request.
Decode the returned token and verify the same claims as in the authorization code grant.
Successful completion of both token requests confirms that OCI IAM is configured
correctly for Oracle Deep Data Security. The
group claim verified in the end-user token is what Oracle AI
Database reads at runtime to activate the corresponding data roles.
You can now proceed to configure Oracle AI
Database to accept and validate these tokens.