且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用基于表单的身份验证来保护我的web api?

更新时间:2023-09-24 13:37:16

亲爱的Naufal07,



顶部您输入的控制器方法:



Dear Naufal07,

On the top of your controller's method you just typed:

[Authorize(Roles = "Administrator")] or [Authorize]





如果该控制器是管理员使用的方法。











if that controller's method used by Administrator.

or


[Authorize]





就在你的控制器顶部之前



on the top of your controller just before

public class <controller name=""></controller>





您的所有控制器方法都变得安全。



谢谢,

Manoj Kalla



your all method of controller become secure.

Thank You,
Manoj Kalla