Class RestApiBasicAuthenticationHandler
java.lang.Object
org.wso2.carbon.registry.rest.api.handler.RestApiBasicAuthenticationHandler
- All Implemented Interfaces:
org.apache.cxf.jaxrs.ext.RequestHandler
public class RestApiBasicAuthenticationHandler
extends Object
implements org.apache.cxf.jaxrs.ext.RequestHandler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.ResponsehandleRequest(org.apache.cxf.message.Message message, org.apache.cxf.jaxrs.model.ClassResourceInfo classResourceInfo) Implementation of RequestHandler.handleRequest method.
-
Field Details
-
log
protected org.apache.commons.logging.Log log
-
-
Constructor Details
-
RestApiBasicAuthenticationHandler
public RestApiBasicAuthenticationHandler()
-
-
Method Details
-
handleRequest
public javax.ws.rs.core.Response handleRequest(org.apache.cxf.message.Message message, org.apache.cxf.jaxrs.model.ClassResourceInfo classResourceInfo) Implementation of RequestHandler.handleRequest method. This method retrieves userName and password from Basic auth header, and tries to authenticate against carbon user store Upon successful authentication allows process to proceed to retrieve requested REST resource Upon invalid credentials returns a HTTP 401 UNAUTHORIZED response to client Upon receiving a userStoreExceptions or IdentityException returns HTTP 500 internal server error to client- Specified by:
handleRequestin interfaceorg.apache.cxf.jaxrs.ext.RequestHandler- Parameters:
message-classResourceInfo-- Returns:
- Response
-