public class CmsDefaultAuthorizationHandler extends A_CmsAuthorizationHandler
I_CmsAuthorizationHandler.I_PrivilegedLoginAction| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
AUTHORIZATION_BASIC_PREFIX
Basic authorization prefix constant.
|
static java.lang.String |
HEADER_AUTHORIZATION
Authorization header constant.
|
static java.lang.String |
SEPARATOR_CREDENTIALS
Credentials separator constant.
|
LOG, m_parameters| 构造器和说明 |
|---|
CmsDefaultAuthorizationHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected CmsObject |
checkBasicAuthorization(javax.servlet.http.HttpServletRequest req)
Checks if the current request contains HTTP basic authentication information in
the headers, if so the user is tried to log in with this data, and on success a
session is generated.
|
java.lang.String |
getLoginFormURL(java.lang.String loginFormURL,
java.lang.String params,
java.lang.String callbackURL)
Returns the full URL used to call a login form with additional parameters and a callbackURL.
|
CmsObject |
initCmsObject(javax.servlet.http.HttpServletRequest request)
Creates a new cms object from the given request object.
|
CmsObject |
initCmsObject(javax.servlet.http.HttpServletRequest request,
I_CmsAuthorizationHandler.I_PrivilegedLoginAction loginAction)
Creates a new cms object from the given request object.
|
CmsObject |
initCmsObject(javax.servlet.http.HttpServletRequest request,
java.lang.String userName,
java.lang.String pwd)
Authenticates the current request with additional user information.
|
void |
requestAuthorization(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.lang.String loginFormURL)
This method sends a request to the client to display a login form,
it is needed for HTTP-Authentication.
|
initCmsObjectFromSession, registerSession, setParameterspublic static final java.lang.String AUTHORIZATION_BASIC_PREFIX
public static final java.lang.String HEADER_AUTHORIZATION
public static final java.lang.String SEPARATOR_CREDENTIALS
public java.lang.String getLoginFormURL(java.lang.String loginFormURL,
java.lang.String params,
java.lang.String callbackURL)
I_CmsAuthorizationHandlerloginFormURL - the form URL specified in the cms (either as a property or system-wide)params - additional parameters to provide to the login formcallbackURL - the call-back URL to redirect after a successful loginI_CmsAuthorizationHandler.getLoginFormURL(java.lang.String, java.lang.String, java.lang.String)public CmsObject initCmsObject(javax.servlet.http.HttpServletRequest request)
I_CmsAuthorizationHandlerThis method is called by OpenCms every time a resource is requested and the session can not automatically be authenticated.
request - the HTTP request to authenticateI_CmsAuthorizationHandler.initCmsObject(HttpServletRequest)public CmsObject initCmsObject(javax.servlet.http.HttpServletRequest request, I_CmsAuthorizationHandler.I_PrivilegedLoginAction loginAction)
I_CmsAuthorizationHandlerThis method is called by OpenCms every time a resource is requested and the session can not automatically be authenticated.
request - the HTTP request to authenticateloginAction - the privileged login actionI_CmsAuthorizationHandler.initCmsObject(javax.servlet.http.HttpServletRequest, org.opencms.security.I_CmsAuthorizationHandler.I_PrivilegedLoginAction)public CmsObject initCmsObject(javax.servlet.http.HttpServletRequest request, java.lang.String userName, java.lang.String pwd) throws CmsException
I_CmsAuthorizationHandlerYou have to call this method by your own.
request - the HTTP request to authenticateuserName - the user name to authenticatepwd - the user password to authenticate withCmsException - if something goes wrongI_CmsAuthorizationHandler.initCmsObject(HttpServletRequest, String, String)public void requestAuthorization(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.lang.String loginFormURL)
throws java.io.IOException
req - the client requestres - the responseloginFormURL - the full URL used for form based authenticationjava.io.IOException - if something goes wrongprotected CmsObject checkBasicAuthorization(javax.servlet.http.HttpServletRequest req)
req - the current HTTP requestnull if failed