|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dyuproject.openid.OpenIdServletFilter
public class OpenIdServletFilter
A servlet filter that forwards users to the login page if they are not authenticated and redirects the user to their openid provider once they've submitted their openid identifier. The required web.xml configuration is the init-parameter "forwardUri".
Nested Class Summary | |
---|---|
static interface |
OpenIdServletFilter.ForwardUriHandler
Pluggable handler to dispatch the request to a view/template. |
Field Summary | |
---|---|
protected OpenIdServletFilter.ForwardUriHandler |
_forwardHandler
|
protected String |
_forwardUri
|
protected RelyingParty |
_relyingParty
|
static String |
DEFAULT_ERROR_MSG
|
static OpenIdServletFilter.ForwardUriHandler |
DEFAULT_FORWARD_URI_HANDLER
The default forward uri handler that basically executes: request.getRequestDispatcher(forwardUri).forward(request, response); |
static String |
ERROR_MSG_ATTR
|
static String |
ID_NOT_FOUND_MSG
|
Constructor Summary | |
---|---|
OpenIdServletFilter()
|
Method Summary | |
---|---|
void |
destroy()
|
void |
doFilter(ServletRequest req,
ServletResponse res,
FilterChain chain)
Delegates to the filter chain if the user associated with this request is authenticated. |
String |
getForwardUri()
Gets the configured forward uri. |
RelyingParty |
getRelyingParty()
Gets the configured relying party. |
boolean |
handle(HttpServletRequest request,
HttpServletResponse response)
Returns true if the user associated with this request is authenticated. |
static boolean |
handle(HttpServletRequest request,
HttpServletResponse response,
RelyingParty relyingParty,
OpenIdServletFilter.ForwardUriHandler forwardUriHandler,
String forwardUri)
Returns true if the user associated with this request is authenticated. |
static boolean |
handle(HttpServletRequest request,
HttpServletResponse response,
String forwardUri)
Returns true if the user associated with this request is authenticated. |
void |
init(FilterConfig config)
This method is called by the servlet container to configure this filter; The init parameter "forwardUri" is required. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ERROR_MSG_ATTR
public static final String DEFAULT_ERROR_MSG
public static final String ID_NOT_FOUND_MSG
public static final OpenIdServletFilter.ForwardUriHandler DEFAULT_FORWARD_URI_HANDLER
protected String _forwardUri
protected RelyingParty _relyingParty
protected OpenIdServletFilter.ForwardUriHandler _forwardHandler
Constructor Detail |
---|
public OpenIdServletFilter()
Method Detail |
---|
public void init(FilterConfig config) throws ServletException
instance
if it is not found in the servlet context attributes.
init
in interface Filter
ServletException
public String getForwardUri()
public RelyingParty getRelyingParty()
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException
doFilter
in interface Filter
IOException
ServletException
public void destroy()
destroy
in interface Filter
public boolean handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
IOException
ServletException
public static boolean handle(HttpServletRequest request, HttpServletResponse response, String forwardUri) throws IOException, ServletException
IOException
ServletException
public static boolean handle(HttpServletRequest request, HttpServletResponse response, RelyingParty relyingParty, OpenIdServletFilter.ForwardUriHandler forwardUriHandler, String forwardUri) throws IOException, ServletException
IOException
ServletException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |