org.springframework.security.oauth2.provider.endpoint
类 TokenEndpoint

java.lang.Object
  继承者 org.springframework.security.oauth2.provider.endpoint.AbstractEndpoint
      继承者 org.springframework.security.oauth2.provider.endpoint.TokenEndpoint
所有已实现的接口:
org.springframework.beans.factory.InitializingBean

@RequestMapping(value="/oauth/token")
public class TokenEndpoint
extends AbstractEndpoint

Endpoint for token requests as described in the OAuth2 spec. Clients post requests with a grant_type parameter (e.g. "authorization_code") and other parameters as determined by the grant type. Supported grant types are handled by the provided token granter.

Clients must be authenticated using a Spring Security Authentication to access this endpoint, and the client id is extracted from the authentication token. The best way to arrange this (as per the OAuth2 spec) is to use HTTP basic authentication for this endpoint with standard Spring Security support.

作者:
Dave Syer

字段摘要
 
从类 org.springframework.security.oauth2.provider.endpoint.AbstractEndpoint 继承的字段
logger
 
构造方法摘要
TokenEndpoint()
           
 
方法摘要
 org.springframework.http.ResponseEntity<OAuth2AccessToken> getAccessToken(Principal principal, Map<String,String> parameters)
           
protected  String getClientId(Principal principal)
           
 org.springframework.http.ResponseEntity<OAuth2Exception> handleClientRegistrationException(Exception e)
           
 org.springframework.http.ResponseEntity<OAuth2Exception> handleException(Exception e)
           
 void setoAuth2RequestValidator(OAuth2RequestValidator oAuth2RequestValidator)
           
 
从类 org.springframework.security.oauth2.provider.endpoint.AbstractEndpoint 继承的方法
afterPropertiesSet, getClientDetailsService, getDefaultOAuth2RequestFactory, getExceptionTranslator, getOAuth2RequestFactory, getTokenGranter, setClientDetailsService, setOAuth2RequestFactory, setProviderExceptionHandler, setTokenGranter
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

TokenEndpoint

public TokenEndpoint()
方法详细信息

getAccessToken

@RequestMapping
public org.springframework.http.ResponseEntity<OAuth2AccessToken> getAccessToken(Principal principal,
                                                                                                @RequestParam
                                                                                                Map<String,String> parameters)

getClientId

protected String getClientId(Principal principal)
参数:
principal - the currently authentication principal
返回:
a client id if there is one in the principal

handleClientRegistrationException

@ExceptionHandler(value=ClientRegistrationException.class)
public org.springframework.http.ResponseEntity<OAuth2Exception> handleClientRegistrationException(Exception e)
                                                                                           throws Exception
抛出:
Exception

handleException

@ExceptionHandler(value=OAuth2Exception.class)
public org.springframework.http.ResponseEntity<OAuth2Exception> handleException(Exception e)
                                                                         throws Exception
抛出:
Exception

setoAuth2RequestValidator

public void setoAuth2RequestValidator(OAuth2RequestValidator oAuth2RequestValidator)


Copyright © 2013. All rights reserved.