public class OAuthServlet extends Object
| Constructor and Description |
|---|
OAuthServlet() |
| Modifier and Type | Method and Description |
|---|---|
static OAuthMessage |
getMessage(javax.servlet.http.HttpServletRequest request,
String URL)
Extract the parts of the given request that are relevant to OAuth.
|
static String |
getRequestURL(javax.servlet.http.HttpServletRequest request)
Reconstruct the requested URL, complete with query string (if any).
|
static void |
handleException(javax.servlet.http.HttpServletResponse response,
Exception e,
String realm) |
static void |
handleException(javax.servlet.http.HttpServletResponse response,
Exception e,
String realm,
boolean sendBody) |
static String |
htmlEncode(String s)
Return the HTML representation of the given plain text.
|
static void |
sendForm(javax.servlet.http.HttpServletResponse response,
Iterable<? extends Map.Entry> parameters)
Send the given parameters as a form-encoded response body.
|
public static OAuthMessage getMessage(javax.servlet.http.HttpServletRequest request, String URL)
URL - the official URL of this service; that is the URL a legitimate
client would use to compute the digital signature. If this
parameter is null, this method will try to reconstruct the URL
from the HTTP request; which may be wrong in some cases.public static String getRequestURL(javax.servlet.http.HttpServletRequest request)
public static void handleException(javax.servlet.http.HttpServletResponse response,
Exception e,
String realm)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic static void handleException(javax.servlet.http.HttpServletResponse response,
Exception e,
String realm,
boolean sendBody)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic static void sendForm(javax.servlet.http.HttpServletResponse response,
Iterable<? extends Map.Entry> parameters)
throws IOException
IOExceptionpublic static String htmlEncode(String s)
Copyright 2015- Charles R. Severance and licensed CC-BY Attribution 4.0