Interface I_CmsAuthorizationHandler

All Known Implementing Classes:
A_CmsAuthorizationHandler, CmsDefaultAuthorizationHandler, CmsPersistentLoginAuthorizationHandler

public interface I_CmsAuthorizationHandler
Defines general authorization methods.

One of the application scenarios for this interface is a personalized SSO implementation.

Since:
6.5.4
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Class providing the privileged login action.
  • Method Summary

    Modifier and Type
    Method
    Description
    getLoginFormURL(String loginFormURL, String params, String callbackURL)
    Returns the full URL used to call a login form with additional parameters and a callbackURL.
    default String
    getLogoutRedirectUri(CmsObject cms, jakarta.servlet.http.HttpServletRequest request, String cmsRedirectUri)
    Implementations can customize the logout redirect URI using this method.
    initCmsObject(jakarta.servlet.http.HttpServletRequest request)
    Creates a new cms object from the given request object.
    initCmsObject(jakarta.servlet.http.HttpServletRequest request, String userName, String pwd)
    Authenticates the current request with additional user information.
    initCmsObject(jakarta.servlet.http.HttpServletRequest request, I_CmsAuthorizationHandler.I_PrivilegedLoginAction loginAction)
    Creates a new cms object from the given request object.
    void
    requestAuthorization(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, String loginFormURL)
    This method sends a request to the client to display a login form, it is needed for HTTP-Authentication.
    void
    Sets parameters which can be configured additionally for an authorization handler.
  • Method Details

    • getLoginFormURL

      String getLoginFormURL(String loginFormURL, String params, String callbackURL)
      Returns the full URL used to call a login form with additional parameters and a callbackURL.

      Parameters:
      loginFormURL - the form URL specified in the cms (either as a property or system-wide)
      params - additional parameters to provide to the login form
      callbackURL - the call-back URL to redirect after a successful login
      Returns:
      the full URL used to call a login form
    • getLogoutRedirectUri

      default String getLogoutRedirectUri(CmsObject cms, jakarta.servlet.http.HttpServletRequest request, String cmsRedirectUri)
      Implementations can customize the logout redirect URI using this method.
      Parameters:
      cms - the current CmsObject
      request - the current request
      cmsRedirectUri - the normal redirect URI that would be used without a special authorization handler (might be null)
      Returns:
      the new redirect URI
      Throws:
      Exception - if something goes wrong
    • initCmsObject

      CmsObject initCmsObject(jakarta.servlet.http.HttpServletRequest request)
      Creates a new cms object from the given request object.

      This method is called by OpenCms every time a resource is requested and the session can not automatically be authenticated.

      Parameters:
      request - the HTTP request to authenticate
      Returns:
      the cms context object associated to the current session
    • initCmsObject

      CmsObject initCmsObject(jakarta.servlet.http.HttpServletRequest request, I_CmsAuthorizationHandler.I_PrivilegedLoginAction loginAction)
      Creates a new cms object from the given request object.

      This method is called by OpenCms every time a resource is requested and the session can not automatically be authenticated.

      Parameters:
      request - the HTTP request to authenticate
      loginAction - the privileged login action
      Returns:
      the cms context object associated to the current session
    • initCmsObject

      CmsObject initCmsObject(jakarta.servlet.http.HttpServletRequest request, String userName, String pwd) throws CmsException
      Authenticates the current request with additional user information.

      You have to call this method by your own.

      Parameters:
      request - the HTTP request to authenticate
      userName - the user name to authenticate
      pwd - the user password to authenticate with
      Returns:
      the cms context object associated to the given user
      Throws:
      CmsException - if something goes wrong
    • requestAuthorization

      void requestAuthorization(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res, String loginFormURL) throws IOException
      This method sends a request to the client to display a login form, it is needed for HTTP-Authentication.

      Parameters:
      req - the client request
      res - the response
      loginFormURL - the full URL used for form based authentication
      Throws:
      IOException - if something goes wrong
    • setParameters

      void setParameters(Map<String,String> parameters)
      Sets parameters which can be configured additionally for an authorization handler.

      Parameters:
      parameters - the map of parameters