Category / Section
How-To: Use Email2FA OTP plugin with Gluu Server
Published:
Instructions are applicable to VM based deployments only.
This plugin allows end-users to enable email-based OTP as a second-factor authentication in CASA.
Prerequisites
- Gluu Server instance
Installation
Gluu Server
We need to enable email_2fa_core script in the Gluu Server. There are a couple of configurations required as well.
Enable Script
- Log into Gluu Server as admin
Configuration>Person Authentication Scripts>Add custom script configurationName: email_2fa_coreSelect SAML ACRs: not mandatoryDescription: as you wishProgramming Language: JythonLevel: depends on your policyLocation: DatabaseInteractive: WebCustom property(key/value):token_length: 7token_lifetime: 10
- Take the script from here and paste it in the
Scriptlocation.
- Save it
Email Configuration
You need SSH root access to complete this configuration.
- Go to
/opt/gluu/jetty/oxauth/custom/pages/and create a directory namedcasaif it is not available. - Grab and copy two files in this
casalocation:https://raw.githubusercontent.com/GluuFederation/casa/master/plugins/email_2fa_core/extras/otp_email.xhtmlhttps://raw.githubusercontent.com/GluuFederation/casa/master/plugins/email_2fa_core/extras/otp_email_prompt.xhtml
- Create a file named
oxauth.propertiesinside/opt/gluu/jetty/oxauth/custom/i18n/with the content below:#casa plugin - email otp casa.email_2fa.title= Email OTP casa.email_2fa.text=The Email OTP method enables you to authenticate using the one-time password (OTP) that is sent to the registered email address. casa.email.enter=Enter the code sent via Email casa.email.choose=Choose an email-id to send an OTP to casa.email.send=Send - Grab the latest
casa.xhtmlfromhttps://github.com/GluuFederation/oxAuth/blob/master/Server/src/main/webapp/casa/casa.xhtmland place it inside/opt/gluu/jetty/oxauth/custom/pages/casa/. - Retrieve the image file from
https://github.com/GluuFederation/oxAuth/blob/master/Server/src/main/webapp/img/email-ver.pngand place it inside the/opt/gluu/jetty/oxauth/custom/static/imglocation.
CASA configuration
- Log into CASA with
https://[hostname]/casa - Click on
Administration Console - Navigate to
Casa Plugins - Download the latest
Email_2fa_coreplugin from here: https://maven.gluu.org/maven/org/gluu/casa/plugins/email_2fa_core/ - Upload the jar file you just downloaded
- Wait for some time
Now your Email 2FA OTP is ready to use.