7.2 Register the Application in Microsoft Entra ID
The application serves as both a confidential client (authenticating to Entra ID with a client secret) and a resource server that end users authenticate against.
Application roles defined on this registration flow into the user's JWT
roles claim, which the Oracle AI
Database reads to activate the corresponding data roles.
- Create a registration for your application.
- On the Microsoft Entra portal's Home page, click App registrations in the left navigation pane under Entra ID, and then click New registration.
- Perform the following tasks on the Register an application page:
- Enter a name for the registration in the
Name field; for example,
HCM APP. - For Supported account types, select Single tenant only - Default Directory.
- Under Redirect URI, select
Web from the drop-down field, and
enter
http://localhost:3000. - Click Register.
- Enter a name for the registration in the
Name field; for example,
- From the application’s Overview page, copy and save the application
(client) ID.You'll use this value to configure your application properties.
- Set the application ID URI.This step makes the application a resource, allowing users and other applications to request tokens scoped to it.
- On the application’s Overview page, click Add an Application ID URI.
- Perform the following tasks on the Expose an API page:
- Click Add next to Application ID URI.
- In the panel that appears, accept the default value
api://<your-app-id>, then click Save. - Copy this URI for later use.
- Expose a delegated scope so that end users can request access tokens for the
application.This scope ensures that the access token issued to the user includes their identity and application role assignments. Perform the following tasks on the Expose an API page:
- Under Scopes defined by this API, click Add a scope.
- In the panel that appears, enter the following information:
- Scope name: Enter
user_access. - Who can consent: Select Admins and users.
- Enter
Access HCM APPas the value in all remaining fields. - State: Leave Enabled selected.
- Scope name: Enter
- Create a client secret.The application uses a client secret to authenticate to Entra ID when requesting database-scoped access tokens.
- On the
HCM APPapplication page, under Manage, click Certificates & secrets.The Certificates & secrets page opens. - Click New client secret and enter the following
details:
- Enter a description; for example,
hcm-app-secret. - Set an expiry period according to your organization’s policy.
- Enter a description; for example,
- Copy and save the Value column immediately; it is displayed only once.
- On the
- Grant permissions to the application.The application needs permission to request tokens scoped to the database resource (
OracleDB_Resource).- On the
HCM APPapplication page, under Manage, click API permissions, and then click Add a permission. - Perform the following tasks on the Request API permissions panel:
- Click APIs my organization uses, and then click OracleDB_Resource.
- Select Delegated permissions and check the
box for
sessions:scope:connect. - Click Add permissions.
The permission is successfully added and appears on the API permissions page.
- Click Grant admin consent for Default Directory (or your specific directory name) to authorize the permission, and select Yes in the confirmation dialog box.
- On the
- Define application roles.Application roles control how user permissions flow into the JWT token. When a user is assigned an application role (for example,
MANAGER), that value appears in the token’srolesclaim. Oracle AI Database reads this claim and activates the matching data role.- On the
HCM APPapplication page, click App roles under Manage. - On the App roles page, click Create app role, and enter the
following details:
- Display name: Enter a name for the role; for
example,
MANAGER. - Allowed member types: Select Users/Groups.
- Value: Enter a value; for example,
MANAGER. - Description: Enter a description for the role.
Repeat this step to add as many roles as needed.
- Display name: Enter a name for the role; for
example,
- On the
- Authorize the application as a client of the database.
- At the top of the page, locate the breadcrumb trail, click App registrations.
- On the App registrations page, click the database registration, OracleDB_Resource.
- Under Manage, click Expose an API.
- Under the Authorized client applications section, click Add a client application.
- In the panel that appears, enter the following details:
- Paste the application (client) ID of
HCM APP. - Select the database scope.
- Paste the application (client) ID of
You have now configured the application as both a resource server and a client. It is equipped with a client secret, application roles, delegated permissions, and database pre-authorization.
See also:
Configure an application to expose a web API in the Microsoft identity platform documentation.