Git Product home page Git Product logo

keycloak-login-recaptcha's Introduction

keycloak-login-recaptcha

By default Keycloak ( up to 4.4.0) only supports ReCaptcha for Regsitration, not login. so we created a simple module for activating recaptcha for login

How to use

for building you need to run mvn clean install. it will produce a jar target/recaptcha-login.jar. for making it accessible in Keycloak you should copy this jar into keycloaks standalone/deployment/ directory. just it. if you're using it in docker environment you should mount it in /opt/jboss/keycloak/standalone/deployment/recaptcha-login.jar for example in my docker compose file:

...
keycloak:
	image: jboss/keycloak:4.2.1.Final
	.
	.
	.
	volumes:
		- ./realm-config:/opt/jboss/keycloak/realm-config
		- ./my-theme/:/opt/jboss/keycloak/themes/my-theme/
		- ./kc-recaptcha-module/target/recaptcha-login.jar:/opt/jboss/keycloak/standalone/deployments/recaptcha-login.jar
...

and in your theme file you should add this piece of code in your login.ftl template file:

<#if recaptchaRequired??>
<div class="form-group">
	<div class="${properties.kcInputWrapperClass!}">
		<div class="g-recaptcha" data-size="compact" data-sitekey="${recaptchaSiteKey}">			
		</div>
	</div>
</div>
</#if>

you should past it inside your login <form></form> in your login template (login.ftl)

And finally you should enable external origin https://google.com like the way in keycloaks' Recaptcha Documentation mentioned.

keycloak-login-recaptcha's People

Contributors

unikzforce avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.