10.1 Understand Authentication Flow and Prerequisites
Review the authentication concepts and gather the necessary credentials before modifying your application configuration.
Authentication flow
- End-user token: An OAuth 2.0 access token generated when the end user logs in through the browser. This token establishes the user's identity and role claims (app roles in Microsoft Entra ID or group memberships in OCI IAM).
- Database-access token: An OAuth 2.0 token the application obtains to authorize itself to access the database resource. This is acquired through the on-behalf-of (OBO) flow or the client credentials flow.
The application passes these tokens as part of the end-user security context payload on the database connection; the database-access token authorizes the connection, and the end-user token supplies the user identity and role claims used to enforce data security.
The following table summarizes both the tokens, the claims they carry, and how these tokens are used in Oracle Deep Data Security (Deep Sec).
| Token | Who gets it | Key claims | Who validates it | Used to |
|---|---|---|---|---|
|
End-user token |
End user, after authenticating with the IAM. |
End-user identity:
Application roles:
Application/Client ID:
|
Database, while establishing the end-user security context. The token signature is verified against the IAM’s public signing key. |
Identify the end user (through
Additionally, application/client ID claims are used along with roles claim to map to application-specific data roles if such data roles are present. |
|
Database-access token |
Application, through OBO or client credentials grant. |
Audience: Application/Client ID:
|
Database, at connection time. The audience claim is matched against the database’s identity provider configuration. |
Authorize the application’s database connection, and identify the application's registered identity in the database so that its granted data roles can be enabled. The application/client ID claim must match the
client ID specified in the database’s
|
For troubleshooting claim-related issues in tokens, see End-User Security Context Issues.
Required credentials
Before proceeding to configure your application, ensure you have gathered the following values from your application's IAM registration:
- Client ID: The unique identifier assigned to your application.
- Client secret: The secret key generated for the application.
- Tenant ID (Entra ID) / Domain URL (OCI IAM): The identifier for your IAM instance.
- Database Scope: The scope required
to access the database resource (for example,
[DB_APP_ID_URI]/sessions:scope:connectin Entra ID or[primary_audience]DB_ACCESS_SCOPEin OCI IAM).