I'm struggling with the ASP.NET Core MVC app and the integration to Cognito. I am using the AWS SDK and the hosted UI option.
I have managed to get the sign-in functionality working but am now struggling with the sign-out functionality.
I am basing this on the AWS code at https://catalog.us-east-1.prod.workshops.aws/workshops/02696107-09ac-4313-a6cb-3798048b07d7/en-US/9-how-to-authenticate-users-in-my-application and the example code it supplies.
This has the signout code as the following:
public IActionResult SignOut()
{
var callbackUrl = Url.Page("/", pageHandler: null, values: null, protocol: Request.Scheme);
return SignOut(
new AuthenticationProperties { RedirectUri = callbackUrl },
CookieAuthenticationDefaults.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme
);
}
After tweaking it for my app, this ends up as:
public IActionResult SignOut()
{
var baseUri = $"{Request.Scheme}://{Request.Host}";
//var callbackUrl = Url.Page("/", pageHandler: null, values: null, protocol: Request.Scheme);
return SignOut(
new AuthenticationProperties { RedirectUri = baseUri },
CookieAuthenticationDefaults.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme
);
}
When I run the app and attempt to sign-out, the sign-out seems to function correctly (in that the cookies are removed). However, the Cognito redirect fails with the following error:

When debugging the code it can be seen that the redirect URI is set to "https://localhost:7085"
Within AWS the App Client is defined as follows. I have gone to town trying various options so the URLS are currently set as the following

Any ideas about what I am doing wrong here?