org.springframework.richclient.security.remoting
Class BasicAuthHttpInvokerProxyFactoryBean

Show UML class diagram
java.lang.Object
  extended by org.springframework.remoting.support.RemotingSupport
      extended by org.springframework.remoting.support.RemoteAccessor
          extended by org.springframework.remoting.support.UrlBasedRemoteAccessor
              extended by org.springframework.remoting.support.RemoteInvocationBasedAccessor
                  extended by org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
                      extended by org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
                          extended by org.springframework.richclient.security.remoting.BasicAuthHttpInvokerProxyFactoryBean
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor, BeanClassLoaderAware, FactoryBean, InitializingBean, HttpInvokerClientConfiguration, AuthenticationAware

public class BasicAuthHttpInvokerProxyFactoryBean
extends HttpInvokerProxyFactoryBean
implements AuthenticationAware

Extension of HttpInvokerProxyFactoryBean that supports the use of BASIC authentication on each HTTP request. This factory takes care of instantiating the proper invocation executor, BasicAuthHttpInvokerRequestExecutor, and keeping it up to date with the latest user credentials. Once a more complete AOP implementation is available, then this "token forwarding" can be removed as the default executor is already wired to receive notifications when it is constructed by the application context.

This configuration assumes that the user's credentials are "global" to the application and every invocation should use the same credentials. If you need per-thread authentication then you should look at using a combination of HttpInvokerProxyFactoryBean and org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor.

AuthenticationAware is implemented in order to get notifications of changes in the user's credentials. Please see the class documentation for AuthenticationAware to see how to configure the application context so that authentication changes are broadcast properly.

Author:
Larry Streepy

Field Summary
 
Fields inherited from class org.springframework.remoting.support.RemotingSupport
logger
 
Constructor Summary
BasicAuthHttpInvokerProxyFactoryBean()
          Constructor.
 
Method Summary
 void setAuthenticationToken(org.springframework.security.Authentication authentication)
          Handle a change in the current authentication token.
 
Methods inherited from class org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
afterPropertiesSet, getObject, getObjectType, isSingleton
 
Methods inherited from class org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor
convertHttpInvokerAccessException, executeRequest, executeRequest, getCodebaseUrl, getHttpInvokerRequestExecutor, invoke, setCodebaseUrl, setHttpInvokerRequestExecutor
 
Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedAccessor
createRemoteInvocation, getRemoteInvocationFactory, recreateRemoteInvocationResult, setRemoteInvocationFactory
 
Methods inherited from class org.springframework.remoting.support.UrlBasedRemoteAccessor
getServiceUrl, setServiceUrl
 
Methods inherited from class org.springframework.remoting.support.RemoteAccessor
getServiceInterface, setServiceInterface
 
Methods inherited from class org.springframework.remoting.support.RemotingSupport
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration
getServiceUrl
 

Constructor Detail

BasicAuthHttpInvokerProxyFactoryBean

public BasicAuthHttpInvokerProxyFactoryBean()
Constructor. Install the default executor.

Method Detail

setAuthenticationToken

public void setAuthenticationToken(org.springframework.security.Authentication authentication)
Handle a change in the current authentication token. Pass it along to the executor if it's of the proper type.

Specified by:
setAuthenticationToken in interface AuthenticationAware
Parameters:
authentication - token
See Also:
BasicAuthHttpInvokerRequestExecutor, AuthenticationAware.setAuthenticationToken(org.springframework.security.Authentication)


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.