Re: Simple login rewrite

Splash Forums Rewrite Users Simple login rewrite Re: Simple login rewrite

#22925

RedShadow
Participant

To finally close the question I will summarize what worked for me.

Making “/admin” the entry point for logged in and not logged in users:

.addRule(Join.path("/admin").to("/login.xhtml").when(Not.any(loggedIn)))

.addRule(Join.path("/admin").to("/admin.xhtml").when(loggedIn));

Forward every different request to login when not logged in:

.defineRule().when(Direction.isInbound().and(Path.matches("/{0}").where("0").matches(".*"))

.andNot(Path.matches("/javax.faces.resource{0}").where("0").matches(".*"))

.andNot(Path.matches("/login.xhtml"))

.perform(Forward.to("/login.xhtml"))

The remaining part of the question is, why is the session id appended to the url as path parameter on the very first request and how could I remove it?