How to UseCookieAuthentication OR ClaimsIdentity between ASP.NET Identity Owin site and ASP.NET WebAPI -
i have asp.net web application using asp.net identity login usecookieauthentication in startup.
login site working fine.
have asp.net webapi site use gather data. secure webapi same cookie created @ login web site.
machine keys identical , usecookieauthentication using same cookiename , cookiedomain settings.
i can't seem find articles on how use cookie based auth between asp.net sites.
any links or ideas welcome.
if there examples passing claimsidentity between 2 sites great.
choose usecookieauthentication because similar formsauthentication not opposed using claims authentication if find out how.
working adding
app.usecors(microsoft.owin.cors.corsoptions.allowall);
i recommend claimsidentity instead of trying pass around cookies. way can "register" web application webapi application.
i'm assuming description web app , webapi app on different domains or @ least different virtual directories on server. if so, you'll want take @ cors well.
here few relevant articles: http://www.jayway.com/2014/09/25/securing-asp-net-web-api-endpoints-using-owin-oauth-2-0-and-claims/
http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api
if web app consumer of webapi code , can hosted on same server, may consider adding webapi code web app solution. won't have worry cors.
Comments
Post a Comment