com.force.sdk.springsecurity
Class OAuthAuthenticationProvider
java.lang.Object
com.force.sdk.springsecurity.OAuthAuthenticationProvider
- All Implemented Interfaces:
- org.springframework.security.authentication.AuthenticationProvider
public class OAuthAuthenticationProvider
- extends Object
- implements org.springframework.security.authentication.AuthenticationProvider
The AuthenticationProvider
used for Force.com authentication. Uses the
ForceOAuthConnector
to get the access token when an access code is present.
- Author:
- John Simone
Method Summary |
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication)
If this is the access code callback request use the ForceOAuthConnector to retrieve the
access token. |
static org.springframework.security.core.Authentication |
createAuthentication(SecurityContext sc)
Create an authentication object from the SecurityContext . |
void |
setOauthConnector(ForceOAuthConnector oauthConnector)
|
boolean |
supports(Class authentication)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OAuthAuthenticationProvider
public OAuthAuthenticationProvider()
setOauthConnector
public void setOauthConnector(ForceOAuthConnector oauthConnector)
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
throws org.springframework.security.core.AuthenticationException
- If this is the access code callback request use the
ForceOAuthConnector
to retrieve the
access token.
- Specified by:
authenticate
in interface org.springframework.security.authentication.AuthenticationProvider
- Parameters:
authentication
- Authentication
- Returns:
Authentication
- Throws:
org.springframework.security.core.AuthenticationException
- when authentication fails
supports
public boolean supports(Class authentication)
- Specified by:
supports
in interface org.springframework.security.authentication.AuthenticationProvider
createAuthentication
public static org.springframework.security.core.Authentication createAuthentication(SecurityContext sc)
- Create an authentication object from the
SecurityContext
.
- Parameters:
sc
- SecurityContext
- Returns:
- an
OAuthAuthenticationToken
which is used as the Authentication
object by the Spring Security
Copyright © 2011. All Rights Reserved.