Apache CXF API

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

java.lang.Object
  extended by org.apache.cxf.rs.security.oauth2.services.AbstractOAuthService
      extended by org.apache.cxf.rs.security.oauth2.services.AbstractTokenService
Direct Known Subclasses:
AccessTokenService, TokenRevocationService

public class AbstractTokenService
extends AbstractOAuthService


Constructor Summary
AbstractTokenService()
           
 
Method Summary
protected  Client authenticateClientIfNeeded(javax.ws.rs.core.MultivaluedMap<String,String> params)
          Make sure the client is authenticated
protected  void compareTlsCertificates(TLSSessionInfo tlsInfo, String base64EncodedCert)
           
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  Client getAndValidateClientFromIdAndSecret(String clientId, String clientSecret)
           
protected  Client getClient(String clientId)
          Get the Client reference
protected  Client getClientFromBasicAuthScheme()
           
protected  Client getClientFromTLSCertificates(javax.ws.rs.core.SecurityContext sc, TLSSessionInfo tlsSessionInfo)
           
protected  String getClientIdFromTLSCertificates(javax.ws.rs.core.SecurityContext sc, TLSSessionInfo tlsInfo)
           
protected  javax.ws.rs.core.Response handleException(OAuthServiceException ex, String error)
           
 boolean isCanSupportPublicClients()
           
protected  void reportInvalidClient()
           
protected  void reportInvalidClient(OAuthError error)
           
 void setCanSupportPublicClients(boolean support)
           
 void setClientIdProvider(ClientIdProvider clientIdProvider)
           
 void setWriteCustomErrors(boolean writeCustomErrors)
           
 
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

AbstractTokenService

public AbstractTokenService()
Method Detail

authenticateClientIfNeeded

protected Client authenticateClientIfNeeded(javax.ws.rs.core.MultivaluedMap<String,String> params)
Make sure the client is authenticated


getAndValidateClientFromIdAndSecret

protected Client getAndValidateClientFromIdAndSecret(String clientId,
                                                     String clientSecret)

getClientFromBasicAuthScheme

protected Client getClientFromBasicAuthScheme()

getClientFromTLSCertificates

protected Client getClientFromTLSCertificates(javax.ws.rs.core.SecurityContext sc,
                                              TLSSessionInfo tlsSessionInfo)

getClientIdFromTLSCertificates

protected String getClientIdFromTLSCertificates(javax.ws.rs.core.SecurityContext sc,
                                                TLSSessionInfo tlsInfo)

compareTlsCertificates

protected void compareTlsCertificates(TLSSessionInfo tlsInfo,
                                      String base64EncodedCert)

handleException

protected javax.ws.rs.core.Response handleException(OAuthServiceException ex,
                                                    String error)

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()

setWriteCustomErrors

public void setWriteCustomErrors(boolean writeCustomErrors)

setClientIdProvider

public void setClientIdProvider(ClientIdProvider clientIdProvider)

Apache CXF API

Apache CXF