Interface CarbonUIAuthenticator

All Known Implementing Classes:
AbstractCarbonUIAuthenticator, BasicAuthUIAuthenticator, DefaultCarbonAuthenticator

public interface CarbonUIAuthenticator
This is the interface of the Authenticator to Carbon UI framework. Implement this interface in a bundle and drop-in to the framework and it will be automatically called. The authenticator has the freedom to decide how it does the authentication. When an authentication request is received by the framework each authenticator will be checked to see who handles the request, i.e. isHandle() method of each authenticator will be called in the priority order given by the getPriority() method. Highest priority authenticator that returns true for the isHandle() method will be given the responsibility of authentication. Priority is defined as higher the number higher the priority.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    authenticate(javax.servlet.http.HttpServletRequest request)
    Authenticates the given request.
    void
    authenticateWithCookie(javax.servlet.http.HttpServletRequest request)
    Handles authentication during a session expiration.
    boolean
    canHandle(javax.servlet.http.HttpServletRequest request)
    This method will check whether given request can be handled by the authenticator.
    Gets a list of urls to skip authentication.
    Returns the name of the authenticator.
    int
    Gets the authenticator priority.
    Gets a list of urls to skip session validation.
    boolean
    By default all the authenticators found in the system are enabled.
    boolean
    If Authenticator does not need to have login page - set this to true.
    void
    Invalidates the authentication session.
  • Method Details

    • canHandle

      boolean canHandle(javax.servlet.http.HttpServletRequest request)
      This method will check whether given request can be handled by the authenticator. If authenticator is capable of handling given request this method will return true. Else this will return false.
      Parameters:
      object - The request to authenticate.
      Returns:
      true if this authenticator can handle the request, else false.
    • authenticate

      void authenticate(javax.servlet.http.HttpServletRequest request) throws org.wso2.carbon.core.common.AuthenticationException
      Authenticates the given request.
      Parameters:
      object - The request to be authenticate.
      Throws:
      org.wso2.carbon.core.common.AuthenticationException - If an error occurred during authentication process.
    • authenticateWithCookie

      void authenticateWithCookie(javax.servlet.http.HttpServletRequest request) throws org.wso2.carbon.core.common.AuthenticationException
      Handles authentication during a session expiration. Usually the request is a cookie.
      Parameters:
      object - The request to be re-authenticated.
      Throws:
      org.wso2.carbon.core.common.AuthenticationException - If an error occurred during authentication process.
    • unauthenticate

      void unauthenticate(Object object) throws Exception
      Invalidates the authentication session. TODO why we need this ? An authenticator should not maintain a session
      Parameters:
      object - The request to invalidate TODO (?)
      Throws:
      Exception - If an error occurred during authentication process.
    • getPriority

      int getPriority()
      Gets the authenticator priority.
      Returns:
      The integer representing the priority. Higher the value, higher the priority.
    • getAuthenticatorName

      String getAuthenticatorName()
      Returns the name of the authenticator.
      Returns:
      The name of the authenticator.
    • isDisabled

      boolean isDisabled()
      By default all the authenticators found in the system are enabled. Can use this property to control default behavior.
      Returns:
      true if this authenticator is disabled, else false.
    • getAuthenticationSkippingUrls

      List<String> getAuthenticationSkippingUrls()
      Gets a list of urls to skip authentication. Also see CarbonSecuredHttpContext.skipSSOSessionInvalidation for more information.
      Returns:
      A list of urls to skip authentication.
    • getSessionValidationSkippingUrls

      List<String> getSessionValidationSkippingUrls()
      Gets a list of urls to skip session validation. Also see CarbonSecuredHttpContext.skipSSOSessionInvalidation for more information.
      Returns:
      A list of urls to skip session validation.
    • skipLoginPage

      boolean skipLoginPage()
      If Authenticator does not need to have login page - set this to true.
      Returns: