Decoupling Asp.net Identity 2 web api from project?

angularjs asp.net-authorization asp.net-identity-2 bearer-token entity-framework-6

Question

I constructed a Web API 2 project for Asp.net by using instructions like like as. For my users as such, I've expanded the identity models to utilize int keys. I am now unable to separate this "Auth API" from my main project in any way. I am aware of the many benefits and drawbacks of both having a single DbContext and several DbContexts. According to the current course of action, the Auth project is entirely independent of my other "core" project, which houses all other business entities and logic. This is where I'm at a loss.

I use AngularJs for my front end. I can use the Auth API to log in, log out, receive a refresh token, acquire an access token, etc. The bearer token is then passed in the permission header when I make a request to my "core API." I check Fiddler and see that it is being transmitted correctly. The issue is that my User is never authenticated in the core API controller, and I constantly get a 401 answer. When the "Core" API is entirely divorced from the "Auth" API, how can I authorize a user in that API? I assumed that sending the bearer token alone would be sufficient; am I totally mistaken?

1
0
6/29/2015 7:58:10 PM

Popular Answer

Look at the this set of instructions by the same author; Part 5 is the one you need.

0
6/29/2015 8:02:45 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow