[keycloak-user] Redirect Programmatically to the Loginpage

Alex Fernandes alex at labela.nl
Tue Jul 26 13:52:07 EDT 2016


Hi,

Im green to KeyCloak; Wanted to thank the community for it, so far looking
great.

I have an issue where I want to redirect the user the loginpage on the
KeyCloak server programmatically in Java;

the UseCase is:

We have a page that is partially visible and partiallly not (when not
logged in), so I can't protect it with url pattern;

We have a login button on that page that when the user is not logged and
pressed the button, we want to redirect to the loginpage (on keycloak) and
back to the page again.

I'm using the KeyCloak adapter core (running on tomcat8)

[image: Inline afbeelding 2]


I coppied this code from the: KeycloakOIDCFilter (
https://github.com/keycloak/keycloak/blob/master/adapters/oidc/servlet-filter/src/main/java/org/keycloak/adapters/servlet/KeycloakOIDCFilter.java
)

it does show a 302 in the logs but the page doesn't redirect;

Anyone has a clue about how to go about this?

Much Appreciated,
Cheers!

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160726/e3c900f2/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 64823 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/keycloak-user/attachments/20160726/e3c900f2/attachment-0001.png 


More information about the keycloak-user mailing list