default Principal authenticate(Properties props) throws AuthenticationFailedException { return authenticate(props, null); }
@Override default void init(Properties securityProps) throws AuthenticationFailedException { init(securityProps, null, null); }
/** * Method is package protected to be used in testing. */ Principal invokeAuthenticator(Properties securityProps, DistributedMember member, Properties credentials) throws AuthenticationFailedException { String authMethod = securityProps.getProperty(SECURITY_PEER_AUTHENTICATOR); org.apache.geode.security.Authenticator auth = null; try { auth = CallbackInstantiator.getObjectOfType(authMethod, org.apache.geode.security.Authenticator.class); LogWriter logWriter = this.services.getLogWriter(); LogWriter securityLogWriter = this.services.getSecurityLogWriter(); // this.securityProps contains security-ldap-basedn but security-ldap-baseDomainName is // expected auth.init(this.securityProps, logWriter, securityLogWriter); return auth.authenticate(credentials, member); } catch (GemFireSecurityException gse) { throw gse; } catch (Exception ex) { throw new AuthenticationFailedException( "Failed to acquire Authenticator object", ex); } finally { if (auth != null) auth.close(); } }
Method instanceGetter = ClassLoadUtil.methodFromName(authenticatorMethod); auth = (Authenticator) instanceGetter.invoke(null, (Object[]) null); auth.init(securityProperties, logWriter, securityLogWriter); return auth.authenticate(credentials, member); } finally { if (auth != null) { auth.close();