net.adamcin.httpsig.http.servlet
Class ServletUtil

java.lang.Object
  extended by net.adamcin.httpsig.http.servlet.ServletUtil

public final class ServletUtil
extends Object

Helper methods for use in a Servlet context.


Method Summary
static Authorization getAuthorization(javax.servlet.http.HttpServletRequest request)
          Parse an HttpServletRequest to create an Authorization
static RequestContent getRequestContent(javax.servlet.http.HttpServletRequest request)
          Parse an HttpServletRequest to build the RequestContent
static RequestContent getRequestContent(javax.servlet.http.HttpServletRequest request, Collection<String> ignoreHeaders)
          Parse an HttpServletRequest to build the RequestContent
static boolean sendChallenge(javax.servlet.http.HttpServletResponse resp, Challenge challenge)
          Handle an HttpServletResponse which has failed authentication by sending a Challenge header
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAuthorization

public static Authorization getAuthorization(javax.servlet.http.HttpServletRequest request)
Parse an HttpServletRequest to create an Authorization

Parameters:
request - the HTTP Request
Returns:
the Authorization

getRequestContent

public static RequestContent getRequestContent(javax.servlet.http.HttpServletRequest request)
Parse an HttpServletRequest to build the RequestContent

Parameters:
request - the HTTP Request
Returns:
the RequestContent

getRequestContent

public static RequestContent getRequestContent(javax.servlet.http.HttpServletRequest request,
                                               Collection<String> ignoreHeaders)
Parse an HttpServletRequest to build the RequestContent

Parameters:
request - the HTTP Request
ignoreHeaders - a collection of header names to ignore, in case they have been added by proxies
Returns:

sendChallenge

public static boolean sendChallenge(javax.servlet.http.HttpServletResponse resp,
                                    Challenge challenge)
                             throws IOException
Handle an HttpServletResponse which has failed authentication by sending a Challenge header

Parameters:
resp - the HTTP Response
challenge - the Server challenge parameters
Returns:
true if response was flushed successfully, false otherwise
Throws:
IOException - if anything went wrong


Copyright © 2013-2014. All Rights Reserved.