org.springframework.security.oauth.provider.filter
Class UnauthenticatedRequestTokenProcessingFilter

java.lang.Object
  extended by org.springframework.security.oauth.provider.filter.OAuthProviderProcessingFilter
      extended by org.springframework.security.oauth.provider.filter.UnauthenticatedRequestTokenProcessingFilter
All Implemented Interfaces:
Filter, Aware, InitializingBean, MessageSourceAware

public class UnauthenticatedRequestTokenProcessingFilter
extends OAuthProviderProcessingFilter

Processing filter for handling a request for an OAuth token. The default implementation assumes a request for a new unauthenticated request token. The default processes URL is "/oauth_request_token".

Author:
Ryan Heaton, Andrew McCall

Field Summary
 
Fields inherited from class org.springframework.security.oauth.provider.filter.OAuthProviderProcessingFilter
messages, OAUTH_PROCESSING_HANDLED
 
Constructor Summary
UnauthenticatedRequestTokenProcessingFilter()
           
 
Method Summary
protected  OAuthProviderToken createOAuthToken(ConsumerAuthentication authentication)
          Create the OAuth token for the specified consumer key.
 String getResponseContentType()
          The content type of the response.
 boolean isRequire10a()
          Whether to require 1.0a support.
protected  void onNewTimestamp()
          Logic to be performed on a new timestamp.
protected  void onValidSignature(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
          Logic executed on valid signature.
 void setRequire10a(boolean require10a)
          Whether to require 1.0a support.
 void setResponseContentType(String responseContentType)
          The content type of the response.
protected  void validateAdditionalParameters(ConsumerDetails consumerDetails, Map<String,String> oauthParams)
          Do any additional validation checks for the specified oauth params.
 
Methods inherited from class org.springframework.security.oauth.provider.filter.OAuthProviderProcessingFilter
afterPropertiesSet, allowMethod, createDetails, destroy, doFilter, fail, getAuthenticationEntryPoint, getConsumerDetailsService, getFilterProcessesUrl, getNonceServices, getProviderSupport, getSignatureMethodFactory, getTokenServices, init, isIgnoreInadequateCredentials, parametersAreAdequate, requiresAuthentication, resetPreviousAuthentication, setAllowedMethods, setAuthenticationEntryPoint, setConsumerDetailsService, setFilterProcessesUrl, setIgnoreMissingCredentials, setMessageSource, setNonceServices, setProviderSupport, setSignatureMethodFactory, setTokenServices, skipProcessing, validateOAuthParams, validateSignature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnauthenticatedRequestTokenProcessingFilter

public UnauthenticatedRequestTokenProcessingFilter()
Method Detail

validateAdditionalParameters

protected void validateAdditionalParameters(ConsumerDetails consumerDetails,
                                            Map<String,String> oauthParams)
Description copied from class: OAuthProviderProcessingFilter
Do any additional validation checks for the specified oauth params. Default implementation is a no-op.

Overrides:
validateAdditionalParameters in class OAuthProviderProcessingFilter
Parameters:
consumerDetails - The consumer details.
oauthParams - The params.

onValidSignature

protected void onValidSignature(HttpServletRequest request,
                                HttpServletResponse response,
                                FilterChain chain)
                         throws IOException
Description copied from class: OAuthProviderProcessingFilter
Logic executed on valid signature. The security context can be assumed to hold a verified, authenticated ConsumerAuthentication.

Default implementation continues the chain.

Specified by:
onValidSignature in class OAuthProviderProcessingFilter
Parameters:
request - The request.
response - The response
chain - The filter chain.
Throws:
IOException

onNewTimestamp

protected void onNewTimestamp()
                       throws org.springframework.security.core.AuthenticationException
Description copied from class: OAuthProviderProcessingFilter
Logic to be performed on a new timestamp. The default behavior expects that the timestamp should not be new.

Overrides:
onNewTimestamp in class OAuthProviderProcessingFilter
Throws:
org.springframework.security.core.AuthenticationException - If the timestamp shouldn't be new.

createOAuthToken

protected OAuthProviderToken createOAuthToken(ConsumerAuthentication authentication)
Create the OAuth token for the specified consumer key.

Parameters:
authentication - The authentication request.
Returns:
The OAuth token.

getResponseContentType

public String getResponseContentType()
The content type of the response.

Returns:
The content type of the response.

setResponseContentType

public void setResponseContentType(String responseContentType)
The content type of the response.

Parameters:
responseContentType - The content type of the response.

isRequire10a

public boolean isRequire10a()
Whether to require 1.0a support.

Returns:
Whether to require 1.0a support.

setRequire10a

public void setRequire10a(boolean require10a)
Whether to require 1.0a support.

Parameters:
require10a - Whether to require 1.0a support.


Copyright © 2012. All Rights Reserved.