private Subject authenticateCaller(Map environment, Object credentials) { JMXAuthenticator authenticator = (JMXAuthenticator) environment.get(JMXConnectorServer.AUTHENTICATOR); Subject subject = null; if(authenticator != null) { subject = authenticator.authenticate(credentials); } return subject; }
/** * We actually wait for the first authentication request to delegate/ * @param credentials * @return */ public Subject authenticate(Object credentials) { // lazy init... // todo : lloyd, if this becomes a performance bottleneck, we should cache // on first access. JMXAuthenticator controller = mHabitat.getService(JMXAuthenticator.class); return controller.authenticate(credentials); } };
public Subject authenticate(Object credentials) { if (delegate == null) { throw new SecurityException("Delegate JMXAuthenticator not configured"); } Subject subject = delegate.authenticate(credentials); if (JmxSecurity.AUTHENTICATION == security) { // only perform authentication return subject; } if (authorize(subject)) { return subject; } else { throw new SecurityException("Access denied"); } }
public Subject authenticate(Object credentials) { if (delegate == null) { throw new SecurityException("Delegate JMXAuthenticator not configured"); } Subject subject = delegate.authenticate(credentials); if (JmxSecurity.AUTHENTICATION == security) { // only perform authentication return subject; } if (authorize(subject)) { return subject; } else { throw new SecurityException("Access denied"); } }
/** * Authenticates a Subject with the given credentials, by looking up a JMXAuthenticator * in the environment returned by {@link #getEnvironment}. */ protected Subject authenticate(Object credentials) throws IOException, SecurityException { Map environment = getEnvironment(); if (environment != null) { JMXAuthenticator authenticator = (JMXAuthenticator)environment.get(JMXConnectorServer.AUTHENTICATOR); if (authenticator != null) { return authenticator.authenticate(credentials); } } return null; } }
if (authenticator != null) { final Object[] credentials = { connectionId, subject }; subject = authenticator.authenticate(credentials); if (mc instanceof SocketConnectionIf) ((SocketConnectionIf) mc).setSubject(subject); connectionId = mc.getConnectionId();