Apache CXF API

org.apache.cxf.rs.security.oauth2.services
Class AccessTokenService

java.lang.Object
  extended by org.apache.cxf.rs.security.oauth2.services.AbstractOAuthService
      extended by org.apache.cxf.rs.security.oauth2.services.AccessTokenService

@Path(value="/token")
public class AccessTokenService
extends AbstractOAuthService

OAuth2 Access Token Service implementation


Constructor Summary
AccessTokenService()
           
 
Method Summary
protected  void checkAudience(javax.ws.rs.core.MultivaluedMap<String,String> params)
           
protected  javax.ws.rs.core.Response createErrorResponse(javax.ws.rs.core.MultivaluedMap<String,String> params, String error)
           
protected  javax.ws.rs.core.Response createErrorResponseFromBean(OAuthError errorBean)
           
protected  AccessTokenGrantHandler findGrantHandler(javax.ws.rs.core.MultivaluedMap<String,String> params)
          Find the matching grant handler
 List<String> getAudiences()
           
protected  Client getClient(String clientId)
          Get the Client reference
 javax.ws.rs.core.Response handleTokenRequest(javax.ws.rs.core.MultivaluedMap<String,String> params)
          Processes an access token request
 boolean isCanSupportPublicClients()
           
protected  void reportInvalidClient()
           
protected  void reportInvalidClient(OAuthError error)
           
 void setAudiences(List<String> audiences)
           
 void setCanSupportPublicClients(boolean support)
           
 void setGrantHandler(AccessTokenGrantHandler handler)
          Sets a grant handler
 void setGrantHandlers(List<AccessTokenGrantHandler> handlers)
          Sets the list of optional grant handlers
 void setWriteCustomErrors(boolean write)
           
 
Methods inherited from class org.apache.cxf.rs.security.oauth2.services.AbstractOAuthService
checkTransportSecurity, getDataProvider, getMessageContext, getQueryParameters, getValidClient, getValidClient, isWriteOptionalParameters, reportInvalidRequestError, reportInvalidRequestError, reportInvalidRequestError, reportInvalidRequestError, setBlockUnsecureRequests, setDataProvider, setMessageContext, setWriteOptionalParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessTokenService

public AccessTokenService()
Method Detail

setWriteCustomErrors

public void setWriteCustomErrors(boolean write)

setGrantHandlers

public void setGrantHandlers(List<AccessTokenGrantHandler> handlers)
Sets the list of optional grant handlers

Parameters:
handlers - the grant handlers

setGrantHandler

public void setGrantHandler(AccessTokenGrantHandler handler)
Sets a grant handler

Parameters:
handler - the grant handler

handleTokenRequest

public javax.ws.rs.core.Response handleTokenRequest(javax.ws.rs.core.MultivaluedMap<String,String> params)
Processes an access token request

Parameters:
params - the form parameters representing the access token grant
Returns:
Access Token or the error

checkAudience

protected void checkAudience(javax.ws.rs.core.MultivaluedMap<String,String> params)

findGrantHandler

protected AccessTokenGrantHandler findGrantHandler(javax.ws.rs.core.MultivaluedMap<String,String> params)
Find the matching grant handler


createErrorResponse

protected javax.ws.rs.core.Response createErrorResponse(javax.ws.rs.core.MultivaluedMap<String,String> params,
                                                        String error)

createErrorResponseFromBean

protected javax.ws.rs.core.Response createErrorResponseFromBean(OAuthError errorBean)

getClient

protected Client getClient(String clientId)
Get the Client reference

Parameters:
clientId - the provided client id
Returns:
Client the client reference
Throws:
{@link - javax.ws.rs.WebApplicationException} if no matching Client is found

reportInvalidClient

protected void reportInvalidClient()

reportInvalidClient

protected void reportInvalidClient(OAuthError error)

setCanSupportPublicClients

public void setCanSupportPublicClients(boolean support)

isCanSupportPublicClients

public boolean isCanSupportPublicClients()

getAudiences

public List<String> getAudiences()

setAudiences

public void setAudiences(List<String> audiences)

Apache CXF API

Apache CXF