Decoupling Asp.net Identity 2 web api from project?

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

Question

I have created an Asp.net Web API 2 project following tutorials like this one. I've extended the identity models to use int keys for my users like so. Now I am stuck on how to completely decouple this "Auth API" from my core project. I'm aware of the many pros/cons to having a single DbContext, and having multiple DbContexts. The path I'm on now has the Auth project completely separate from my other "core" project which contains all other business entities and logic. Here is where I'm stuck.

I have an AngularJs front end. I can call the Auth API to get an access token, refresh token, log in, out, etc. I then call my "core API" and pass the bearer token in the authorization header. I look in fiddler and see its being sent properly. The problem is my User in the core API controller is never authenticated and I always receive a 401 response. How do I authorize a user in the "Core" API when its completely decoupled from the "Auth" API? I though just sending the bearer token would do... am I completely missing something?

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

Popular Answer

Take a look at this set of tutorials by the same author, the bit you want is Part 5

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