Using a colon (:) in the return URL using forms authentication ("The return URL specified to redirect the request is not valid")

I get the error "The return URL specified to redirect the request is invalid" when using forms authentication. I found this thread that says this is a known issue with return URLs that contain colons (I really have several).

The workaround in this thread is to catch the error and use the default returned URL ... is hardly an acceptable solution. I can try to avoid colons in URLS, but this is a bit of a pain.

Is there any other alternative?

+1
source share
1 answer

The colon is a reserved character, behind the RFC URI . You cannot put unencoded :in a request or hash of a URI, period.

So you need a% -encode colon.

+2
source

Source: https://habr.com/ru/post/1743024/


All Articles