简体   繁体   中英

ASP.NET Web API Basic Authentication

I'm on a project and we are trying to add authorization for a document exposed via Web API. The document will be viewed using a link in another ASP.NET web application.

Is it possible to use Basic Authentication to secure the web API method and have the client send in the credentials of the user that is currently logged in to the ASP.NET web site when the link is clicked on the site? How can this be achieved?

The controller is not on the same site as the web application.

在每个API Controller上放置[Authorized]标签,以检查登录用户。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM