return url is url encoded twice
Experiencing the same issue as https://github.com/IdentityServer/IdentityServer4/issues/4280
We are connecting identity server to an ALB authentication https://docs.aws.amazon.com/elasticloadbalancing/latest/application/listener-authenticate-users.html#configure-user-authentication and the return URL is getting URL encoded twice. Thus, when it redirects back to the ALB redirect URI, the state parameter doesn't match due to it having been URL encoded twice.
https://github.com/IdentityServer/IdentityServer4/blob/main/src/IdentityServer4/src/Endpoints/Results/LoginPageResult.cs#L74
_request.Raw.ToQueryString() this encodes the redirect uri in the return url
https://github.com/IdentityServer/IdentityServer4/blob/main/src/IdentityServer4/src/Endpoints/Results/LoginPageResult.cs#L85
var url = loginUrl.AddQueryString(_options.UserInteraction.LoginReturnUrlParameter, returnUrl); this encodes it again