com.arsdigita.kernel.security
Interface SecurityHelper

All Known Implementing Classes:
DefaultSecurityHelper

public interface SecurityHelper

Provides methods for determining security properties for a request.

Author:
Sameer Ajmani

Field Summary
static String versionId
           
 
Method Summary
 String getLoginURL(javax.servlet.http.HttpServletRequest req)
          Determines where to redirect the client to log in.
 boolean isSecure(javax.servlet.http.HttpServletRequest req)
          Determines whether the given request is secure.
 boolean requiresLogin(javax.servlet.http.HttpServletRequest req)
          Determines whether the given request requires the user to be logged in.
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Method Detail

isSecure

public boolean isSecure(javax.servlet.http.HttpServletRequest req)
Determines whether the given request is secure. Implementation may simply return req.isSecure(), but certain deployments may use other information (such as the requested port number) instead.

Parameters:
req - the request to check
Returns:
true if the given request uses a secure protocol, false otherwise.

requiresLogin

public boolean requiresLogin(javax.servlet.http.HttpServletRequest req)
Determines whether the given request requires the user to be logged in. If this method returns true, the system will call getLoginURL to determine where to redirect the client to log in.

Parameters:
req - the request to check
Returns:
true if the given request requires the user to be logged in, false otherwise.

getLoginURL

public String getLoginURL(javax.servlet.http.HttpServletRequest req)
Determines where to redirect the client to log in. The system calls this method if the user fails to log in and requiresLogin(req) is true.

Returns:
the URL to which the client should be redirected to log in, never null.


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC