简体   繁体   中英

Authentication and authorization ASP.NET Web API from another Web API Application

Hi everyone I have an issue, I have one Asp.NET Web.API application with User management functionality from example Create User manage User Permissions ect, and now I have developed another Web.API application and I need to implement authentication and authorization via first application users credentials. What is the best approach or solution to achieve this goal? Note that in first app I changed the classic Role base Authorization into Permission based.

Thanks in advance for any help.

I have developed another Web.API application and I need to implement authentication and authorization via first application users credentials.

There are a lot of ways to implement the solution. One way is use to token-based authentication using Identity Server .

You could test my sample code at GitHub .

Please note that it uses InMemory Identity Database with hard-coded username and password for testing. You could replace with real Identity Database easily.

I had a similar issue so I moved all of my authentication and authorization into an IHTTP Module. This allowed me to set the applications module in IIS 7.0. https://msdn.microsoft.com/en-us/library/ms227673.aspx

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