GithubHelp home page GithubHelp logo

2yuri / keycloak-verify-email-by-code Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redfroggy/keycloak-verify-email-by-code

0.0 1.0 0.0 186 KB

Required action to verify email by code

License: MIT License

Dockerfile 0.68% Java 85.53% FreeMarker 13.79%

keycloak-verify-email-by-code's Introduction

keycloak-verify-email-by-code

Required action to verify email by code

This Keycloak plugin adds a required action to verify email by code.

Build Status

Features

  • Send code on your email
  • Verify email by code

Compatibility

The version 15.x of this plugin is compatible with Keycloak 15.1.1 and higher.

Installation

The plugin installation is simple and can be done without a Keycloak server restart.

  • Download the latest release from the releases page
  • Copy the JAR file into the standalone/deployments directory in your Keycloak server's root
  • Restart Keycloak (optional, hot deployment should work)

You can also clone the Github Repository and install the plugin locally with the following command:

$ mvn clean install wildfly:deploy

How to use it

Requirements

Verify required action is deploy in keycloak. Got to {keycloak url}/auth/admin/master/console/#/server-info/providers.

server-info_providers

Configuration

Once the installation is complete, the Verify Email by code required action appears in " authentication/required-actions" on your realm. Register and enable "VERIFY_EMAIL_CODE" and disable "VERIFY_EMAIL" required-actions-conf

required-actions-conf

Once enabled, you can add the following action on user edit page:

verify-action-user

Templates

You can override individual templates in your own theme. To create a custom email message for the mytheme theme copy themes/base/email/email-verification-with-code.ftl (in keycloak theme) to themes/mytheme/email/

To create a custom email verify form for the mytheme theme copy template login-verify-email-code.ftl to themes/mytheme/login

Code length and symbols

Verify email code is generated using org.keycloak.common.util.RandomString. By default generated code will be 8 characters long and will use alphanumeric symbols. You may customize this behavior using SPI configuration in your standalone.xml file:

  • property codeLength is a numeric value representing the number of symbols, defaults to 8
  • property codeSymbols is a string value listing all accepted symbols, defaults to RandomString.alphanum

e.g. configure action to generate a code of 6 digits :

<subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">
    [...]
    <spi name="required-action">
        <provider name="VERIFY_EMAIL_CODE" enabled="true">
            <properties>
                <property name="codeLength" value="6"/>
                <property name="codeSymbols" value="0123456789"/>
            </properties>
        </provider>
    </spi>
</subsystem>

Q&A

See Q&A

How to contribute

See here

keycloak-verify-email-by-code's People

Contributors

dajay avatar jul13n-cfm7 avatar

Watchers

 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.