/** * Method will remove any previous bypass set in the authentication. * * @param authentication - the authentication */ default void updateAuthenticationToForgetBypass(final Authentication authentication) { authentication.addAttribute(AUTHENTICATION_ATTRIBUTE_BYPASS_MFA, Boolean.FALSE); }
/** * Method will set the bypass into the authentication. * * @param authentication - the authentication * @param provider - the provider */ default void updateAuthenticationToRememberBypass(final Authentication authentication, final MultifactorAuthenticationProvider provider) { authentication.addAttribute(AUTHENTICATION_ATTRIBUTE_BYPASS_MFA, Boolean.TRUE); authentication.addAttribute(AUTHENTICATION_ATTRIBUTE_BYPASS_MFA_PROVIDER, provider.getId()); }