Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

WebAPI + MVC authenication using 1 db context

$
0
0

Hello,

I'm not sure where this goes since its a  cross of 2 worlds. I have a project that has a mobile experience and consumes a WEBAPI to carry out CRUD operations on the server. The authentication all works correctly via a token based auth using the default in built mechanism.

We've since then added a dashboard page via MVC this again requires authentication. I had the project set-up using WEBAPI's via ajax and was getting the MVC to give me the HTML. We then shifted away from using the API's since there's no cross over and instead would have 2 different methods of authenicating. One - the WEBAPI's for the mobile part, the other being webforms.

My issue is getting both context's to talk to one database. I've tried to abstract the database context out and then inherit from the IndentityContext. This works when I update the database via migrations for the WebAPI's but then when I attempt to login using the same account which was created via the webAPI's using the MVC project it throws a wobley saying the database needs to be updated.

My question is...

Is it possible to have this configuration? 

If so, can anyone point me in the right direction to get the solution working

Ta.


Viewing all articles
Browse latest Browse all 4850


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>