IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

return url is url encoded twice

Open twhite-conga opened this issue 4 years ago • 1 comments

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.

twhite-conga avatar Oct 08 '21 19:10 twhite-conga

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

twhite-conga avatar Oct 08 '21 23:10 twhite-conga