I have a two tier setup and I am looking to implement full authentication / session management with the following structure:
- Service A is an ASP MVC web application
- Service B is a typical service stack rest API service.
I have been reading about the way to implement a custom auth provider in Service B so that I can control access to the API calls.
Additionally I have read that I can initialize the client connection from A to B using the following approach
var client = new JsonServiceClient(BaseUrl);
var authResponse = client.Post(new Authenticate {
provider = CredentialsAuthProvider.Name, //= credentials
UserName = "test@gmail.com",
Password = "p@55w0rd",
RememberMe = true,
});
Using this approach, it appears that I am using a single admin account through to the API, whereas I would like to pass through the session token based on which user is currently using the website.
Is there a standardized way that I can pass through the session token available in service A in the request to service B. Yes the token itself will have been provided from B to A as a result of the login process so service B will have the corresponding session in its session cache.