Authenticate HTTP .NET client against Self Host Web API Windows Service

假装没事ソ 提交于 2020-01-14 07:26:40

问题


I found great article about client/server implementation via Self Host Web API http://www.asp.net/web-api/overview/older-versions/self-host-a-web-api

And I am wondering about the correct authentication method for this model (Self Host Web API ).

Have I use a bearer token authentication? Is there any other method?

Or for example http://www.asp.net/web-api/overview/security/individual-accounts-in-web-api

I have following working requirements:

  1. C# http client must connect to Self Host Web API Windows Service and send files.

  2. The connection must be secure 100%.

So how to protect WebAPI, any clue?


回答1:


Have you checked this answer?

ASP.NET Web API Self-Host with Windows Authentication

Looks like is working quite well with Windows Authentication.

BTW, Bearer it's probably more flexible, but it depends on your needs.

BTW(2): HTTPS is a must if you want to achive an high level of security, but 100% looks veeery high :)



来源:https://stackoverflow.com/questions/35751411/authenticate-http-net-client-against-self-host-web-api-windows-service

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