org.surfnet.oaaas.resource
Class TokenResource

java.lang.Object
  extended by org.surfnet.oaaas.resource.TokenResource

@Named
public class TokenResource
extends Object

Resource for handling all calls related to tokens. It adheres to the OAuth spec.


Field Summary
static String BASIC_REALM
           
static String WWW_AUTHENTICATE
           
 
Constructor Summary
TokenResource()
           
 
Method Summary
 javax.ws.rs.core.Response authorizeCallback(javax.servlet.http.HttpServletRequest request)
          Entry point for the authorize call which needs to return an authorization code or (implicit grant) an access token
 javax.ws.rs.core.Response authorizeCallbackGet(javax.servlet.http.HttpServletRequest request)
           
 javax.ws.rs.core.Response consentCallback(javax.servlet.http.HttpServletRequest request)
          Called after the user has given consent
protected  String getAuthorizationCodeValue()
           
protected  String getTokenValue(boolean isRefreshToken)
           
 void setAccessTokenRepository(AccessTokenRepository accessTokenRepository)
           
 void setAuthorizationRequestRepository(AuthorizationRequestRepository authorizationRequestRepository)
           
 void setoAuth2Validator(OAuth2Validator oAuth2Validator)
           
 javax.ws.rs.core.Response token(String authorization, javax.ws.rs.core.MultivaluedMap<String,String> formParameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASIC_REALM

public static final String BASIC_REALM
See Also:
Constant Field Values

WWW_AUTHENTICATE

public static final String WWW_AUTHENTICATE
See Also:
Constant Field Values
Constructor Detail

TokenResource

public TokenResource()
Method Detail

authorizeCallbackGet

public javax.ws.rs.core.Response authorizeCallbackGet(@Context
                                                      javax.servlet.http.HttpServletRequest request)

authorizeCallback

public javax.ws.rs.core.Response authorizeCallback(@Context
                                                   javax.servlet.http.HttpServletRequest request)
Entry point for the authorize call which needs to return an authorization code or (implicit grant) an access token

Parameters:
request - the HttpServletRequest
Returns:
Response the response

consentCallback

public javax.ws.rs.core.Response consentCallback(@Context
                                                 javax.servlet.http.HttpServletRequest request)
Called after the user has given consent

Parameters:
request - the HttpServletRequest
Returns:
Response the response

token

public javax.ws.rs.core.Response token(@HeaderParam(value="Authorization")
                                       String authorization,
                                       javax.ws.rs.core.MultivaluedMap<String,String> formParameters)

getTokenValue

protected String getTokenValue(boolean isRefreshToken)

getAuthorizationCodeValue

protected String getAuthorizationCodeValue()

setAuthorizationRequestRepository

public void setAuthorizationRequestRepository(AuthorizationRequestRepository authorizationRequestRepository)
Parameters:
authorizationRequestRepository - the authorizationRequestRepository to set

setAccessTokenRepository

public void setAccessTokenRepository(AccessTokenRepository accessTokenRepository)
Parameters:
accessTokenRepository - the accessTokenRepository to set

setoAuth2Validator

public void setoAuth2Validator(OAuth2Validator oAuth2Validator)
Parameters:
oAuth2Validator - the oAuth2Validator to set


Copyright © 2012-2013 SURFnet bv, The Netherlands. All Rights Reserved.