Created
June 23, 2020 10:45
-
-
Save nipunthathsara/6fb80370ba6aa343f7e52735d3f9dbd5 to your computer and use it in GitHub Desktop.
Enable Two Factor for Facebook authentication - Adaptive script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define the list of Social Identity Providers to step up the authentication. | |
var IdPsToStepUp = ['Facebook_IDP']; | |
var onLoginRequest = function(context) { | |
executeStep(1, { | |
// If first step (FB login) was a success then... | |
onSuccess: function (context) { | |
// Check if the first step was Facebook. | |
var idp = context.currentStep.idp; | |
if (IdPsToStepUp.indexOf(idp) >= 0) { | |
// Engage second factor. | |
executeStep(2); | |
} | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment