1 package org.openkilda.security;
3 import org.springframework.beans.factory.annotation.Autowired;
4 import org.springframework.security.authentication.BadCredentialsException;
5 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
6 import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
7 import org.springframework.security.core.Authentication;
26 throws org.springframework.security.core.AuthenticationException {
32 throw new BadCredentialsException(
"Invalid username or password");
35 Authentication
result = super.authenticate(
auth);
41 if(verificationCode == null || verificationCode.isEmpty()) {
48 return new UsernamePasswordAuthenticationToken(user,
result.getCredentials(),
56 public boolean supports(
final Class<?> authentication) {
57 return authentication.equals(UsernamePasswordAuthenticationToken.class);
boolean getIs2FaConfigured()
static boolean validateOtp(final String otp, final String decryptKey)
boolean getIs2FaEnabled()
boolean supports(final Class<?> authentication)
Authentication authenticate(final Authentication auth)
String getVerificationCode()