JWT token data access from action/controller layer

戏子无情 提交于 2021-01-28 00:32:26

问题


I am implementing .Net Core application with OAuth 2.0 JWT authorization and authentication.

In action/controller layer I need an access to JWT payload data of current user (or JWT token as it is).

How is it possible to do?


回答1:


Try:

this.User

in your Controller/Action. If you need claims add .Claims



来源:https://stackoverflow.com/questions/42559490/jwt-token-data-access-from-action-controller-layer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!