사용자 정의 함수로 속성 구성

다음 프로시저 및 cURL 명령을 사용하여 속성에 대한 사용자 정의 함수를 구성하십시오.

프로시저

  1. 해당 Manage Attributes 권한을 사용하여 API 클라이언트를 구성합니다.

    “API 클라이언트 만들기 ”를 참조하십시오.

  2. 다음 클라이언트 인증 정보를 사용하여 액세스 토큰을 가져오십시오.
    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}}'
  3. JSON 응답에서 를 access_token 복사하세요.
  4. 사용자 정의 함수로 속성을 작성하십시오.
    마찬가지로 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"
            }
        }'
  5. 애플리케이션으로 이동하여 필요에 따라 속성 맵핑을 구성하십시오.