Mit Apps arbeiten
In diesem Abschnitt werden die Schritte zum Erteilen von AppRoles für eine App sowie Beispielanforderungen zum Erstellen und Aktivieren von OAuth-Apps beschrieben. Jeder Anwendungsfall enthält auch die erforderlichen App-Attribute.
In diesem Abschnitt werden folgende Themen behandelt:
AppRoles einer App erteilen
Verwenden Sie das folgende Beispiel, um eine Anforderung zu erstellen, die einer Anwendung Anwendungsrollen erteilt.
Das Beispiel umfasst die folgenden Schritte:
Schritt 1: Identifizieren Sie AppRole
Identifizieren Sie die AppRole, die Sie zuweisen möchten.
GET HOST/admin/v1/AppRoles?filter=app.value eq "IDCSAppId"
{
"displayName": "User Administrator",
"id": "...",
"uniqueName": "IDCSAppId_User Administrator",
"app": {
"name": "IDCSApp",
"value": "IDCSAppId",
"display": "IDCS Application",
"$ref": "..."
},
}
Schritt 2: Details abrufen
Rufen Sie die Details der Zielanwendung ab.
GET {{HOST}}/admin/v1/Apps?filter=displayName eq "target-appname"
{
"displayName": "target-appname",
"id": "...",
"grantedAppRoles": [
{
"value": "...",
"$ref": "...",
"appId": "IDCSAppId",
"display": "User Administrator",
"type": "direct",
"appName": "IDCSApp",
"adminRole": true
},
{
"value": "...",
"$ref": "...",
"appId": "IDCSAppId",
"display": "Identity Domain Administrator",
"type": "direct",
"appName": "IDCSApp",
"adminRole": true
}
]
Schritt 3: Erteilen Sie AppRole
Weisen Sie einer App die AppRole zu.
POST {{HOST}}/admin/v1/Grants
{
"grantee": {
"type": "App",
"value": "..." <------- "id" of the app/grantee that the AppRole will be assigned to.
},
"app": {
"value": "IDCSAppId" <------- the AppId to be assigned to the App.
},
"entitlement" : {
"attributeName": "appRoles",
"attributeValue": "..." <---- the "id" of the AppRole e.g, IDA
},
"grantMechanism" : "ADMINISTRATOR_TO_APP",
"schemas": ["urn:ietf:params:scim:schemas:oracle:idcs:Grant"]
}
Schritt 4: Details erneut abrufen
Rufen Sie die Details der Ziel-App erneut ab.
GET {{HOST}}/admin/v1/Apps?filter=displayName eq "target-appname"
{
"displayName": "target-appname",
"id": "...",
"grantedAppRoles": [
{
"value": "...",
"$ref": "...",
"appId": "IDCSAppId",
"display": "User Administrator",
"type": "direct",
"appName": "IDCSApp",
"adminRole": true
},
{
"value": "...",
"$ref": "...",
"appId": "IDCSAppId",
"display": "Identity Domain Administrator",
"type": "direct",
"appName": "IDCSApp",
"adminRole": true
}
]