1

I have the following context:

  1. A Asp.NET MVC 5 web app that is client.

  2. A Web API which communicates with Custom Db (Where Users table is located).

In the AccountController.cs , there is the method Login which uses SignInManager.PasswordSignInAsyn call .

I know I need to use an HttpClient to call the Web API "/Token" url to get the bearer token to be used, when getting API resources, and that this token can be stored in a cookie.

What I need here is make the client web app know that user is logged in. Where should I place this logic (httpClient calling web api to validate user) to make my client web app behaves like the user is authenticated (display email in top menu, access to [Authorize] controller methods, redirect to login page, all this in client web app). ?

2
  • Are the Web and WebAPI parts of your app within the same web project, or hosted separately? Commented Apr 29, 2015 at 1:20
  • See my answer here: stackoverflow.com/questions/26309792/… Commented Apr 29, 2015 at 1:50

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.