OAuth 2端点:其他字段?

时间:2015-01-26 14:41:24

标签: rest oauth oauth-2.0 asp.net-web-api2 owin

是否可以在OAuth令牌端点响应中包含其他字段?

例如,我将在下方返回UserIdUsernameCompanyId

{
    "access_token": "pHd4Wz1EF...",
    "token_type": "bearer",
    "expires_in": 86399,
    "UserId": "7e7fbc39-8abd-41e1-b165-9d18b635b7a7",
    "Username": "user@somewhere.com",
    "CompanyId": "874f380a-76eb-49b1-81b5-a42100f7e4d0",
}

这实质上意味着为了获取此信息,不需要其他请求。

1 个答案:

答案 0 :(得分:2)

你可以这样做 - 但更标准化的解决方案是使用" OpenID Connect"为此目的(见http://openid.net/connect/)。