1 Answer
- Newest
- Most votes
- Most comments
0
Hey,
From the docs you need to use the logout endpoint passing your redirect url
https://mydomain.auth.us-east-1.amazoncognito.com/logout? client_id=ad398u21ijw3s9w3939& logout_uri=https://myclient/logout
Haven't tested this but this should get you going once you have replaced the values below with your values
[HttpGet]
public async Task<IActionResult> LogOff()
{
await HttpContext.SignOutAsync("OpenIdConnect");
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
return Redirect($"https://mydomain.auth.us-east-1.amazoncognito.com/logout?client_id={ClientId}&logout_uri={Request.Scheme}://{Request.Host}");
}
Hope that helps
answered a year ago
Relevant content
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago