org.springframework.security.oauth2.provider.error
Class OAuth2AuthenticationEntryPoint

java.lang.Object
  extended by org.springframework.security.oauth2.provider.error.AbstractOAuth2SecurityExceptionHandler
      extended by org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint
All Implemented Interfaces:
org.springframework.security.web.AuthenticationEntryPoint

public class OAuth2AuthenticationEntryPoint
extends AbstractOAuth2SecurityExceptionHandler
implements org.springframework.security.web.AuthenticationEntryPoint

If authentication fails and the caller has asked for a specific content type response, this entry point can send one, along with a standard 401 status. Add to the Spring Security configuration as an AuthenticationEntryPoint in the usual way.

Author:
Dave Syer

Field Summary
 
Fields inherited from class org.springframework.security.oauth2.provider.error.AbstractOAuth2SecurityExceptionHandler
logger
 
Constructor Summary
OAuth2AuthenticationEntryPoint()
           
 
Method Summary
 void commence(HttpServletRequest request, HttpServletResponse response, org.springframework.security.core.AuthenticationException authException)
           
protected  org.springframework.http.ResponseEntity<OAuth2Exception> enhanceResponse(org.springframework.http.ResponseEntity<OAuth2Exception> response, Exception exception)
          Allow subclasses to manipulate the response before it is rendered.
 void setRealmName(String realmName)
           
 void setTypeName(String typeName)
           
 
Methods inherited from class org.springframework.security.oauth2.provider.error.AbstractOAuth2SecurityExceptionHandler
doHandle, setExceptionRenderer, setExceptionTranslator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuth2AuthenticationEntryPoint

public OAuth2AuthenticationEntryPoint()
Method Detail

setRealmName

public void setRealmName(String realmName)

setTypeName

public void setTypeName(String typeName)

commence

public void commence(HttpServletRequest request,
                     HttpServletResponse response,
                     org.springframework.security.core.AuthenticationException authException)
              throws IOException,
                     ServletException
Specified by:
commence in interface org.springframework.security.web.AuthenticationEntryPoint
Throws:
IOException
ServletException

enhanceResponse

protected org.springframework.http.ResponseEntity<OAuth2Exception> enhanceResponse(org.springframework.http.ResponseEntity<OAuth2Exception> response,
                                                                                   Exception exception)
Description copied from class: AbstractOAuth2SecurityExceptionHandler
Allow subclasses to manipulate the response before it is rendered.

Overrides:
enhanceResponse in class AbstractOAuth2SecurityExceptionHandler
Parameters:
response - the response that was generated by the exception translator.
exception - the authentication exception that is being handled


Copyright © 2012. All Rights Reserved.