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
| 从类 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.