This authentication SPI allows to implement 2factor authentication by sending verification code as SMS using Twilio on mobile device
-
RHSSO instance
-
mvn 3.6.2+
-
java jdk 1.8
-
Twilio configuration - AccountID, Token and FromPhoneNumber
- Provide Twilio configuration as part of RHSSO SPI configuration
mvn clean install
Login to cluster:
oc login <<cluster url >> -u <<username>> -p <<password>>
Get the SSO POD
oc get pods -n <<sso-project=namespace>>
Add the jar to the rhsso server:
$ oc cp target/rhsso-sms1-authenticator-jar-with-dependencies.jar <<sso-pod-name>>:/opt/eap/standalone/deployments
Add two templates to the rhsso server:
$ cp themes/rhsso/login <<sso-pod-name>>:/opt/eap/themes/rhsso/login
Add the jar to the rhsso server:
mvn clean install wildfly:deploy
Add two templates to the rhsso server:
$ cp cp themes/rhsso/login _RHSSO_HOME_/themes/rhsso/login
-
Login to RHSSO Admin Console
-
Select or Create a new Realm (eg. SMS 2FA).
-
Under the selected realm > Authentication > Flows:
- Copy ‘Browser’ Flow and set name as ‘SMS Browser Flow’.
- Under the new flow, set the auth execution Actions > Add execution > Select ‘SMS Twilio’
- Under the new flow, set ‘SMS Twilio’ as Required.
- Set Configuration for the SMS Browser flow by clicking on “Actions > Config” dropdown.
-
Under the selected realm > Authentication > Bindings, select ‘SMS Browser Flow’ as the browser flow for the realm
-
Under the selected realm > Themes, set login theme as dafm-theme or the theme where you copied the above templates.
-
Create a client for the mobile/web application.