@Override public Object getNegotiatedProperty(String propertyName) { return SECURITY_IDENTITY.equals(propertyName) ? securityIdentityCallbackHandler.getSecurityIdentity() : delegate.getNegotiatedProperty(propertyName); }
/** * @see org.wildfly.security.http.HttpServerAuthenticationMechanismFactory#createAuthenticationMechanism(java.lang.String, java.util.Map, javax.security.auth.callback.CallbackHandler) */ @Override public HttpServerAuthenticationMechanism createAuthenticationMechanism(String mechanismName, Map<String, ?> properties, CallbackHandler callbackHandler) throws HttpAuthenticationException { SecurityIdentityCallbackHandler securityIdentityCallbackHandler = new SecurityIdentityCallbackHandler(callbackHandler); final HttpServerAuthenticationMechanism delegate = this.delegate.createAuthenticationMechanism(mechanismName, properties, securityIdentityCallbackHandler); if (delegate != null) { return new HttpServerAuthenticationMechanism() { @Override public String getMechanismName() { return delegate.getMechanismName(); } @Override public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException { delegate.evaluateRequest(request); } @Override public Object getNegotiatedProperty(String propertyName) { return SECURITY_IDENTITY.equals(propertyName) ? securityIdentityCallbackHandler.getSecurityIdentity() : delegate.getNegotiatedProperty(propertyName); } }; } return null; }
/** * @see org.wildfly.security.http.HttpServerAuthenticationMechanismFactory#createAuthenticationMechanism(java.lang.String, java.util.Map, javax.security.auth.callback.CallbackHandler) */ @Override public HttpServerAuthenticationMechanism createAuthenticationMechanism(String mechanismName, Map<String, ?> properties, CallbackHandler callbackHandler) throws HttpAuthenticationException { SecurityIdentityCallbackHandler securityIdentityCallbackHandler = new SecurityIdentityCallbackHandler(callbackHandler); final HttpServerAuthenticationMechanism delegate = this.delegate.createAuthenticationMechanism(mechanismName, properties, securityIdentityCallbackHandler); if (delegate != null) { return new HttpServerAuthenticationMechanism() { @Override public String getMechanismName() { return delegate.getMechanismName(); } @Override public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException { delegate.evaluateRequest(request); } @Override public Object getNegotiatedProperty(String propertyName) { return SECURITY_IDENTITY.equals(propertyName) ? securityIdentityCallbackHandler.getSecurityIdentity() : delegate.getNegotiatedProperty(propertyName); } }; } return null; }
@Override public Object getNegotiatedProperty(String propertyName) { return SECURITY_IDENTITY.equals(propertyName) ? securityIdentityCallbackHandler.getSecurityIdentity() : delegate.getNegotiatedProperty(propertyName); }
@Override public Object getNegotiatedProperty(String propertyName) { return SECURITY_IDENTITY.equals(propertyName) ? securityIdentityCallbackHandler.getSecurityIdentity() : delegate.getNegotiatedProperty(propertyName); }
/** * @see org.wildfly.security.http.HttpServerAuthenticationMechanismFactory#createAuthenticationMechanism(java.lang.String, java.util.Map, javax.security.auth.callback.CallbackHandler) */ @Override public HttpServerAuthenticationMechanism createAuthenticationMechanism(String mechanismName, Map<String, ?> properties, CallbackHandler callbackHandler) throws HttpAuthenticationException { SecurityIdentityCallbackHandler securityIdentityCallbackHandler = new SecurityIdentityCallbackHandler(callbackHandler); final HttpServerAuthenticationMechanism delegate = this.delegate.createAuthenticationMechanism(mechanismName, properties, securityIdentityCallbackHandler); if (delegate != null) { return new HttpServerAuthenticationMechanism() { @Override public String getMechanismName() { return delegate.getMechanismName(); } @Override public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException { delegate.evaluateRequest(request); } @Override public Object getNegotiatedProperty(String propertyName) { return SECURITY_IDENTITY.equals(propertyName) ? securityIdentityCallbackHandler.getSecurityIdentity() : delegate.getNegotiatedProperty(propertyName); } }; } return null; }