如何向ASP.NET身份验证票证添加其他数据?

时间:2017-05-11 09:05:59

标签: c# asp.net json asp.net-mvc asp.net-web-api

我想将一个Json对象添加到响应票据作为我从身份验证令牌获取的属性。我试图在AuthenticationProperties中添加它,但我将该属性作为字符串而不是Json对象。

我想做类似的事情:

{
  "access_token": "T_4ZEoW5-ivHRCrZOUq20u4vaChTbg2QYOwwOEcn_vu_lKxePPv-7Hed3HulsLRiVn6IyCAdcsXP4Fb20ZVkVEpWxwvlCf0AxIwMN5jlf3SzvTJM2FGSpT1nWF98GS7mtYuJhpciEnizIw-Cx-QtWgATfq6IlUGAOv9fk8mJJ",
  "token_type": "bearer",
  "expires_in": 1799,
  "refresh_token": "69c2087223804",
  "as:client_id": "Angular App",
  "userName": "testuser",
  "id": "ca7337cb-42c2-49ea-c9ee-d8d6704583f5",
  ".issued": "Thu, 11 May 2017 08:45:47 GMT",
  ".expires": "Thu, 11 May 2020 09:15:47 GMT",
 "this --> Student": {"name" : "MyName", "surname" : "MySurname"}
}

如何将属性作为对象而不是字符串?

由于

0 个答案:

没有答案