如何在webapi中实现授权 [英] How to implement authorization in webapi
问题描述
我有一个工作的WebApi项目,我需要添加身份验证和授权。我们有一个用户数据库来验证登录凭据。我不知道如何开始在WebApi中实现身份验证。
我已经通过解决方案,完全理解HMAC认证,我可以轻松实现。我不确定是否应该深入研究基于OAuth / Token的身份验证或使用HMAC。我无法为OAuth找到任何此类代码示例。
任何1可以建议我在WebApi中实现身份验证的最佳做法。
我尝试了什么:
我已经通过解决方案,完全理解HMAC身份验证,我可以轻松实现。我不确定是否应该深入研究基于OAuth / Token的身份验证或使用HMAC。我无法为OAuth找到任何此类代码示例。
I have a working WebApi project where I need to add authentication and authorization. We have a User Database to verify login credentials. I am not sure how to start with implementing authentication in WebApi.
I have went through the solution, understood the HMAC authentication completely which I Can easily implement. I am not sure if I should dig more into OAuth/Token based authentication or go with HMAC. I am not able to find any such code samples for OAuth.
Can any 1 suggest me the best practice to implement authentication in WebApi.
What I have tried:
I have went through the solution, understood the HMAC authentication completely which I Can easily implement. I am not sure if I should dig more into OAuth/Token based authentication or go with HMAC. I am not able to find any such code samples for OAuth.
推荐答案
请参阅 Web API-基本身份验证和基于令牌的自定义授权
[ ^ ]
这篇关于如何在webapi中实现授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!