Mit Apps arbeiten

Anwendungsfälle in diesem Abschnitt enthalten die Schritte, um einer App AppRoles zu erteilen, sowie Beispielanforderungen zum Erstellen und Aktivieren von OAuth-Apps. Jeder Anwendungsfall stellt auch die erforderlichen App-Attribute bereit.

In diesem Abschnitt werden folgende Themen behandelt:

AppRoles einer App erteilen

Im folgenden Beispiel können Sie eine Anforderung erstellen, die einer App Anwendungsrollen erteilt.

Das Beispiel enthält die folgenden Schritte:

Schritt 1: Identifizieren Sie AppRole

Geben Sie die AppRole an, 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: AppRole erteilen

Erteilen Sie einer App die AppRole.

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 Zielanwendung 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
      }
]