カスタム関数による属性の構成
以下の手順と cURL コマンドを使用して、属性に対するカスタム関数を構成します。
手順
- Manage Attributes 資格を使用して API クライアントを構成します。
API クライアントの管理を参照してください。
- 以下のクライアント資格情報を使用してアクセス・トークンを取得します。
curl --location --request POST 'https://{{tenant}}/oidc/endpoint/default/token' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=client_credentials' \ --data-urlencode 'client_id={{client_id}}' \ --data-urlencode 'client_secret={{client_secret}}'
- JSON 応答内の
access_token
をコピーします。 - カスタム関数で属性を作成します。同様に、
PUT /v1.0/attributes/{attrId}
を使用して属性を更新できます。 以下のコード例のfunction
プロパティーに注意してください。curl --location --request POST 'https://{{tenant}}/v1.0/attributes' \ --header 'Authorization: Bearer {{access_token}}' \ --header 'Content-Type: application/json' \ --data-raw '{ "name": "echoedUserID", "description": " ", "scope": "tenant", "sourceType": "static", "datatype": "string", "tags": [ "sso" ], "value": "N/A", "function": { "custom": "hc.GetAsJson(\"https://postman-echo.com/get?foo1=bar1&foo2=bar2&userid=\" + user.id, { \"User-Agent\":\"Something\" }).args.userid" } }'
- アプリケーションに移動し、必要に応じて属性マッピングを構成します。