1

In my project, I have three solutions :

  • ASP.NET MVC 5 website (is completed)
  • WEB API 2 MVC 5
  • Model Library(shared between website & web api)

I use the framework Entity & Identity (in website project & web api project) so I have my users in my database with theirs information. Now I'am currently developing Web Api but I don't know how the authentication can be the same than my website.

Where can I configure my web api project to authorize that ? I put the same connection string and I have installed Identity to my web api project.

3
  • 3
    who are the consumers of your API? Commented Oct 23, 2015 at 15:25
  • the consumers of my API will be phone app developped with Xamarin.... Commented Oct 24, 2015 at 16:25
  • First, you should implement EntityFramework DbContext or IdentityDbContext in a separate class library and then reference that to MVC and Web API projects. After that, you should create and implement your custom IdentityConfig class in each project. Commented Dec 9, 2017 at 14:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.