Hi Following from my previous question I need to rediect the user to the login page if the access and refresh token is expired. The problem is that I don't know how to get the address of the login page without hard coding it.
public async Task<ActionResult> Shouts()
{
var authServerInfo = await this.GetAuthenticationServerInfo();
var accessToken = await HttpContext.GetTokenAsync("access_token");
var tokenClient = new TokenClient(authServerInfo.TokenEndpoint, "AuthTest_Code", "secret");
using (var client = new HttpClient())
{
client.SetBearerToken(accessToken);
var content = await client.GetStringAsync("http://localhost:5002/api/Values/Get");
var data = JsonConvert.DeserializeObject<List<String>>(content);
return View("Shouts", data);
}
}