Class AuthenticationHandler

java.lang.Object
org.wso2.carbon.governance.rest.api.security.AuthenticationHandler
All Implemented Interfaces:
org.apache.cxf.jaxrs.ext.RequestHandler

public class AuthenticationHandler extends Object implements org.apache.cxf.jaxrs.ext.RequestHandler
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    protected org.apache.commons.logging.Log
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected javax.ws.rs.core.Response
    handleBasicAuth(org.apache.cxf.configuration.security.AuthorizationPolicy policy, org.apache.cxf.message.Message message)
     
    protected javax.ws.rs.core.Response
    handleOAuth(org.apache.cxf.message.Message message)
     
    javax.ws.rs.core.Response
    handleRequest(org.apache.cxf.message.Message message, org.apache.cxf.jaxrs.model.ClassResourceInfo classResourceInfo)
    Implementation of RequestHandler.handleRequest method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • AuthenticationHandler

      public AuthenticationHandler()
  • 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:
      handleRequest in interface org.apache.cxf.jaxrs.ext.RequestHandler
      Parameters:
      message -
      classResourceInfo -
      Returns:
      Response
    • handleBasicAuth

      protected javax.ws.rs.core.Response handleBasicAuth(org.apache.cxf.configuration.security.AuthorizationPolicy policy, org.apache.cxf.message.Message message)
    • handleOAuth

      protected javax.ws.rs.core.Response handleOAuth(org.apache.cxf.message.Message message)