如何在Asp.net webapi中提供示例基本身份验证 [英] how to provide sample basic authentication in Asp.net webapi

查看:330
本文介绍了如何在Asp.net webapi中提供示例基本身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过使用用户名和密码为服务调用提供身份验证,以便客户端可以使用我的安全服务调用。

解决方案

我不会考虑基本认证是安全的。如果您谷歌asp.net webapi基本身份验证,您将找到包含代码示例的各种文章。除了在服务器端支持它之外,您的客户还需要添加下面描述的Authorization标头;



代码内部博客|在ASP.NET WebAPI中使用基本身份验证 [ ^ ]



ASP.NET Web API中的基本身份验证| ASP.NET站点 [ ^ ]

i want to give authentication for a service call by using username and password, so that clients can use my secured service call.

解决方案

I wouldn't consider basic auth to be "secured". If you google "asp.net webapi basic authentication" you'll find various articles with code samples. As well as supporting it at the server-end, your client needs to add the Authorization header described below;

Code Inside Blog | Using Basic Authentication in ASP.NET WebAPI[^]

Basic Authentication in ASP.NET Web API | The ASP.NET Site[^]


这篇关于如何在Asp.net webapi中提供示例基本身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆