0

I have enabled Keycloak authentication in a website built with Drupal. As soon as I launch the website I want to redirect to Keycloak's login page if the user is not signed in.

Is there any way to achieve this as soon as I open the website

I tried making the default front page of Drupal website as localhost:8080 (which is where Keycloak's login page is present) but was unable to do it.

1 Answer 1

1

If you are experienced with writing custom modules, you can write your own implementation of event subscriber. Here is a good example of it:

https://drupal.stackexchange.com/a/223109/5644

If not, then I recommend the module https://www.drupal.org/project/redirect - I am not 100 per cent sure if it lets you to specify redirect only for anonymous but it is definitely worth trying.

I am assuming that the integration with the Keycloak service is working and out of scope of this question.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.