如何向 okta API 的响应添加更多自定义字段

时间:2021-05-18 10:52:27

标签: json authentication okta-api

我正在使用 okta o 登录,这是我正在调用的 api 端点。

https://xxxxxx.okta.com/api/v1/authn

在身体上

    {
      "username": "xxxxx.merchops.user@gmail.com",
      "password": "Y8m78wZ4",
      "options": {
        "multiOptionalFactorEnroll": true,
        "warnBeforePasswordExpired": true
      }  
    }

I am getting this response.

{
    "stateToken": "00Son-f5Lqr7DxW7cssyVXpLvrqk8Nk8EUPtNP8jpF3m",
    "expiresAt": "2021-05-18T07:21:21.000Z",
    "status": "PASSWORD_EXPIRED",
    "_embedded": {
        "user": {
            "id": "xxurml4yuzhZe5h2A5d6",
            "passwordChanged": "2021-05-18T06:01:57.000Z",
            "profile": {
                "login": "xxxxx.merchops.user@gmail.com",
                "firstName": "chewy",
                "lastName": "Merchops",
                "locale": "en",
                "timeZone": "America/Los_Angeles"
            }
        },
        "policy": {
            "complexity": {
                "minLength": 8,
                "minLowerCase": 1,
                "minUpperCase": 1,
                "minNumber": 1,
                "minSymbol": 0,
                "excludeUsername": true
            },
            "age": {
                "minAgeMinutes": 0,
                "historyCount": 4
            }
        }
    },
    "_links": {
        "next": {
            "name": "changePassword",
            "href": "https://xxxxxxx.okta.com/api/v1/authn/credentials/change_password",
            "hints": {
                "allow": [
                    "POST"
                ]
            }
        },
        "cancel": {
            "href": "https://xxxxxxxx.okta.com/api/v1/authn/cancel",
            "hints": {
                "allow": [
                    "POST"
                ]
            }
        }
    }
}

如果我还想将电话号码添加到响应 json 中,我必须做什么?

我期待这样的事情。请注意,我期望 okta api 的响应 json 上的电话号码字段。

        "profile": {
            "login": "xxxxx.merchops.user@gmail.com",
            "firstName": "chewy",
            "lastName": "Merchops",
            "locale": "en",
            "timeZone": "America/Los_Angeles"
            "Ph":"814744444xx"
        }

我该怎么做?

0 个答案:

没有答案