org.springframework.security.oauth2.http.converter
Class FormOAuth2AccessTokenMessageConverter

java.lang.Object
  extended by org.springframework.http.converter.AbstractHttpMessageConverter<OAuth2AccessToken>
      extended by org.springframework.security.oauth2.http.converter.FormOAuth2AccessTokenMessageConverter
All Implemented Interfaces:
org.springframework.http.converter.HttpMessageConverter<OAuth2AccessToken>

public class FormOAuth2AccessTokenMessageConverter
extends org.springframework.http.converter.AbstractHttpMessageConverter<OAuth2AccessToken>

Converter that can handle inbound form data and convert it to an access token. Needed to support external servers, like Facebook that might not send JSON token data.

Author:
Rob Winch, Dave Syer

Field Summary
 
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
 
Constructor Summary
FormOAuth2AccessTokenMessageConverter()
           
 
Method Summary
protected  OAuth2AccessToken readInternal(Class<? extends OAuth2AccessToken> clazz, org.springframework.http.HttpInputMessage inputMessage)
           
protected  boolean supports(Class<?> clazz)
           
protected  void writeInternal(OAuth2AccessToken accessToken, org.springframework.http.HttpOutputMessage outputMessage)
           
 
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormOAuth2AccessTokenMessageConverter

public FormOAuth2AccessTokenMessageConverter()
Method Detail

supports

protected boolean supports(Class<?> clazz)
Specified by:
supports in class org.springframework.http.converter.AbstractHttpMessageConverter<OAuth2AccessToken>

readInternal

protected OAuth2AccessToken readInternal(Class<? extends OAuth2AccessToken> clazz,
                                         org.springframework.http.HttpInputMessage inputMessage)
                                  throws IOException,
                                         org.springframework.http.converter.HttpMessageNotReadableException
Specified by:
readInternal in class org.springframework.http.converter.AbstractHttpMessageConverter<OAuth2AccessToken>
Throws:
IOException
org.springframework.http.converter.HttpMessageNotReadableException

writeInternal

protected void writeInternal(OAuth2AccessToken accessToken,
                             org.springframework.http.HttpOutputMessage outputMessage)
                      throws IOException,
                             org.springframework.http.converter.HttpMessageNotWritableException
Specified by:
writeInternal in class org.springframework.http.converter.AbstractHttpMessageConverter<OAuth2AccessToken>
Throws:
IOException
org.springframework.http.converter.HttpMessageNotWritableException


Copyright © 2012. All Rights Reserved.