2

I have created a new web api project with individual user account authentication.

I followed this post and everything worked as expected

http://www.asp.net/web-api/overview/security/individual-accounts-in-web-api

Now, I have a token end point localhost:54452/Token

Lets, say I create new asp.net mvc application. I want to use this token end point for authentication. How do I tell my controllers to use this token end point? How do I tell my controllers to pass the bearer access token on each request or how does these two work together.

asp.net mvc and asp.net web api are two different projects with different port numbers

Thanks,

Syed

1 Answer 1

0

I would create a wrapper class that uses HttpClient to issue HTTP requests to the Web API. Then use this wrapper class when you're communicating with the Web API. It will then handle adding the token to the HTTP request header.

Sign up to request clarification or add additional context in comments.

Comments

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.