use of io.gravitee.am.gateway.handler.common.vertx.web.handler.impl.internal.mfa.MFAChallengeStep in project gravitee-access-management by gravitee-io.
the class AuthenticationFlowHandlerTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
List<AuthenticationFlowStep> steps = new LinkedList<>();
steps.add(new MFAEnrollStep(RedirectHandler.create("/mfa/enroll"), ruleEngine, factorManager));
steps.add(new MFAChallengeStep(RedirectHandler.create("/mfa/challenge"), ruleEngine, factorManager));
AuthenticationFlowChainHandler authenticationFlowChainHandler = new AuthenticationFlowChainHandler(steps);
when(jwtService.encode(any(JWT.class), (CertificateProvider) eq(null))).thenReturn(Single.just("token"));
Factor factor = new Factor();
factor.setFactorType(FactorType.SMS);
when(factorManager.getFactor(anyString())).thenReturn(factor);
router.route("/login").order(Integer.MIN_VALUE).handler(new CookieSessionHandler(jwtService, certificateManager, userService, "am-cookie", 30 * 60 * 60));
router.route("/login").handler(authenticationFlowChainHandler).handler(rc -> rc.response().setStatusCode(200).end()).failureHandler(new ErrorHandler());
}
use of io.gravitee.am.gateway.handler.common.vertx.web.handler.impl.internal.mfa.MFAChallengeStep in project gravitee-access-management by gravitee-io.
the class AuthenticationFlowHandlerImpl method create.
@Override
public Handler<RoutingContext> create() {
List<AuthenticationFlowStep> steps = new LinkedList<>();
steps.add(new SPNEGOStep(RedirectHandler.create("/login/SSO/SPNEGO"), identityProviderManager));
steps.add(new FormIdentifierFirstLoginStep(RedirectHandler.create("/login/identifier"), domain));
steps.add(new FormLoginStep(RedirectHandler.create("/login")));
steps.add(new WebAuthnRegisterStep(domain, RedirectHandler.create("/webauthn/register")));
steps.add(new MFAEnrollStep(RedirectHandler.create("/mfa/enroll"), ruleEngine, factorManager));
steps.add(new MFAChallengeStep(RedirectHandler.create("/mfa/challenge"), ruleEngine, factorManager));
return new AuthenticationFlowChainHandler(steps);
}
Aggregations