org.springframework.security.oauth2.config
Class OAuth2ClientContextFactoryBean

java.lang.Object
  extended by org.springframework.security.oauth2.config.OAuth2ClientContextFactoryBean
All Implemented Interfaces:
FactoryBean<OAuth2ClientContext>

public class OAuth2ClientContextFactoryBean
extends Object
implements FactoryBean<OAuth2ClientContext>

Convenience factory for OAuth2ClientContext that is aware of the need for a different context if the resource is for a client credentials grant. Client credentials grants will always have the same credentials for all requests, so there's no point protecting the context with session and request scopes.

Author:
Dave Syer

Constructor Summary
OAuth2ClientContextFactoryBean()
           
 
Method Summary
 OAuth2ClientContext getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setBareContext(OAuth2ClientContext bareContext)
           
 void setResource(OAuth2ProtectedResourceDetails resource)
           
 void setScopedContext(OAuth2ClientContext scopedContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuth2ClientContextFactoryBean

public OAuth2ClientContextFactoryBean()
Method Detail

setResource

public void setResource(OAuth2ProtectedResourceDetails resource)
Parameters:
resource - the resource to set

setScopedContext

public void setScopedContext(OAuth2ClientContext scopedContext)
Parameters:
scopedContext - the scopedContext to set

setBareContext

public void setBareContext(OAuth2ClientContext bareContext)
Parameters:
bareContext - the bareContext to set

getObject

public OAuth2ClientContext getObject()
                              throws Exception
Specified by:
getObject in interface FactoryBean<OAuth2ClientContext>
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean<OAuth2ClientContext>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean<OAuth2ClientContext>


Copyright © 2012. All Rights Reserved.