Skip to content

Instantly share code, notes, and snippets.

@nipunthathsara
Created June 23, 2020 10:45
Show Gist options
  • Save nipunthathsara/6fb80370ba6aa343f7e52735d3f9dbd5 to your computer and use it in GitHub Desktop.
Save nipunthathsara/6fb80370ba6aa343f7e52735d3f9dbd5 to your computer and use it in GitHub Desktop.
Enable Two Factor for Facebook authentication - Adaptive script
// 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