You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pac4j: UrlResolverImpl rewrites absolute URLs of external servers (CAS login URL) with the local host #4010
Since the fix for #3637 (commit 1eb676a), the default pac4j URL resolver (io.jooby.internal.pac4j.UrlResolverImpl) rewrites every absolute URL with the host of the current request. It only keeps the path:
pac4j also uses the URL resolver for URLs that point to external servers. The CAS client is one example: it computes its login URL with it. As a result, the user is redirected to the application itself instead of the CAS server.
The query string of an absolute URL is dropped too, so a login URL like https://cas.example.org/cas/login?locale=fr would lose its parameters even if the host were kept.
Suggested fix: like pac4j's DefaultUrlResolver, only complete relative URLs and return absolute URLs unchanged:
if (isAbsoluteURL(url)) {
returnurl;
}
Workaround: set pac4j's resolver on the client: casClient.setUrlResolver(new DefaultUrlResolver(true));. The pac4j Jooby demo currently does this: https://github.com/pac4j/jooby-pac4j-demo
Activity