mirror of
https://gitee.com/dromara/MaxKey.git
synced 2026-05-15 04:52:09 +08:00
代码优化
This commit is contained in:
@@ -22,8 +22,7 @@ import org.springframework.security.core.Authentication;
|
||||
|
||||
public class AuthenticationProviderFactory extends AbstractAuthenticationProvider {
|
||||
|
||||
private static ConcurrentHashMap<String,AbstractAuthenticationProvider> providers =
|
||||
new ConcurrentHashMap<String,AbstractAuthenticationProvider>();
|
||||
private static ConcurrentHashMap<String,AbstractAuthenticationProvider> providers = new ConcurrentHashMap<>();
|
||||
|
||||
@Override
|
||||
public Authentication authenticate(LoginCredential authentication){
|
||||
|
||||
@@ -42,9 +42,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
*
|
||||
*/
|
||||
public class MfaAuthenticationProvider extends AbstractAuthenticationProvider {
|
||||
private static final Logger _logger =
|
||||
LoggerFactory.getLogger(MfaAuthenticationProvider.class);
|
||||
|
||||
private static final Logger _logger = LoggerFactory.getLogger(MfaAuthenticationProvider.class);
|
||||
|
||||
@Override
|
||||
public String getProviderName() {
|
||||
return "mfa" + PROVIDER_SUFFIX;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ public class MobileAuthenticationProvider extends AbstractAuthenticationProvider
|
||||
|
||||
SmsOtpAuthnService smsOtpAuthnService;
|
||||
|
||||
@Override
|
||||
public String getProviderName() {
|
||||
return "mobile" + PROVIDER_SUFFIX;
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ import org.springframework.security.core.AuthenticationException;
|
||||
*
|
||||
*/
|
||||
public class NormalAuthenticationProvider extends AbstractAuthenticationProvider {
|
||||
private static final Logger _logger =
|
||||
LoggerFactory.getLogger(NormalAuthenticationProvider.class);
|
||||
private static final Logger _logger = LoggerFactory.getLogger(NormalAuthenticationProvider.class);
|
||||
|
||||
@Override
|
||||
public String getProviderName() {
|
||||
return "normal" + PROVIDER_SUFFIX;
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ import org.springframework.security.core.Authentication;
|
||||
*
|
||||
*/
|
||||
public class TrustedAuthenticationProvider extends AbstractAuthenticationProvider {
|
||||
private static final Logger _logger =
|
||||
LoggerFactory.getLogger(TrustedAuthenticationProvider.class);
|
||||
private static final Logger _logger = LoggerFactory.getLogger(TrustedAuthenticationProvider.class);
|
||||
|
||||
@Override
|
||||
public String getProviderName() {
|
||||
return "trusted" + PROVIDER_SUFFIX;
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@ public class JdbcAuthenticationRealm extends AbstractAuthenticationRealm {
|
||||
/**
|
||||
* passwordMatches.
|
||||
*/
|
||||
@Override
|
||||
public boolean passwordMatches(UserInfo userInfo, String password) {
|
||||
boolean passwordMatches = false;
|
||||
//jdbc password check
|
||||
|
||||
@@ -77,6 +77,7 @@ public final class ActiveDirectoryServer implements IAuthenticationServer {
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMapping() {
|
||||
return mapping;
|
||||
}
|
||||
|
||||
@@ -97,6 +97,7 @@ public final class StandardLdapServer implements IAuthenticationServer {
|
||||
this.filterAttribute = filterAttribute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMapping() {
|
||||
return mapping;
|
||||
}
|
||||
|
||||
@@ -66,23 +66,23 @@ public class HttpCertsEntryPoint implements AsyncHandlerInterceptor {
|
||||
for (X509Certificate cert : certificates) {
|
||||
cert.checkValidity();
|
||||
_logger.debug("cert validated");
|
||||
_logger.debug("cert infos " + cert.toString());
|
||||
_logger.debug("Version " + cert.getVersion());
|
||||
_logger.debug("SerialNumber " + cert.getSerialNumber().toString(16));
|
||||
_logger.debug("SubjectDN " + cert.getSubjectDN());
|
||||
_logger.debug("IssuerDN " + cert.getIssuerDN());
|
||||
_logger.debug("NotBefore " + cert.getNotBefore());
|
||||
_logger.debug("SigAlgName " + cert.getSigAlgName());
|
||||
_logger.debug("cert infos {}" , cert.toString());
|
||||
_logger.debug("Version {}" , cert.getVersion());
|
||||
_logger.debug("SerialNumber {}" , cert.getSerialNumber().toString(16));
|
||||
_logger.debug("SubjectDN {}" , cert.getSubjectDN());
|
||||
_logger.debug("IssuerDN {}" , cert.getIssuerDN());
|
||||
_logger.debug("NotBefore {}" , cert.getNotBefore());
|
||||
_logger.debug("SigAlgName {}" , cert.getSigAlgName());
|
||||
byte[] sign = cert.getSignature();
|
||||
_logger.debug("Signature ");
|
||||
for (int j = 0; j < sign.length; j++){
|
||||
_logger.debug(sign[j] + ",");
|
||||
_logger.debug("{} , ",sign[j] );
|
||||
}
|
||||
java.security.PublicKey pk = cert.getPublicKey();
|
||||
byte[] pkenc = pk.getEncoded();
|
||||
_logger.debug("PublicKey ");
|
||||
for (int j = 0; j < pkenc.length; j++){
|
||||
_logger.debug(pkenc[j] + ",");
|
||||
_logger.debug("{} ,",pkenc[j]);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -30,6 +30,7 @@ public class RemoteKerberosService implements KerberosService{
|
||||
private static Logger _logger = LoggerFactory.getLogger(RemoteKerberosService.class);
|
||||
List<KerberosProxy> kerberosProxys;
|
||||
|
||||
@Override
|
||||
public List<KerberosProxy> getKerberosProxys() {
|
||||
return kerberosProxys;
|
||||
}
|
||||
@@ -38,6 +39,7 @@ public class RemoteKerberosService implements KerberosService{
|
||||
this.kerberosProxys = kerberosProxys;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String buildKerberosProxys(){
|
||||
List<Map<String,String>>userDomainUrlList=new ArrayList<Map<String,String>>();
|
||||
for (KerberosProxy kerberosProxy :kerberosProxys){
|
||||
|
||||
@@ -92,6 +92,7 @@ public class JdbcRemeberMeManager extends AbstractRemeberMeManager {
|
||||
public RemeberMe read(RemeberMe remeberMe) {
|
||||
List<RemeberMe> listRemeberMe = jdbcTemplate.query(DEFAULT_DEFAULT_SELECT_STATEMENT,
|
||||
new RowMapper<RemeberMe>() {
|
||||
@Override
|
||||
public RemeberMe mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||
RemeberMe remeberMe = new RemeberMe();
|
||||
remeberMe.setId(rs.getString(1));
|
||||
|
||||
@@ -31,6 +31,7 @@ public class WsFederationServiceImpl implements WsFederationService{
|
||||
this.wsFederationConfiguration = wsFederationConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WsFederationConfiguration getWsFederationConfiguration() {
|
||||
return wsFederationConfiguration;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user