public class OAuthServlet
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.String,java.lang.Integer> |
PROBLEM_TO_HTTP_CODE |
private static java.lang.Integer |
SC_FORBIDDEN |
Constructor and Description |
---|
OAuthServlet() |
Modifier and Type | Method and Description |
---|---|
static OAuthMessage |
getMessage(javax.servlet.http.HttpServletRequest request,
java.lang.String URL)
Extract the parts of the given request that are relevant to OAuth.
|
static java.lang.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,
java.lang.Exception e,
java.lang.String realm) |
static void |
handleException(javax.servlet.http.HttpServletResponse response,
java.lang.Exception e,
java.lang.String realm,
boolean sendBody) |
static java.lang.String |
htmlEncode(java.lang.String s)
Return the HTML representation of the given plain text.
|
static void |
sendForm(javax.servlet.http.HttpServletResponse response,
java.lang.Iterable<? extends java.util.Map.Entry> parameters)
Send the given parameters as a form-encoded response body.
|
private static final java.lang.Integer SC_FORBIDDEN
private static final java.util.Map<java.lang.String,java.lang.Integer> PROBLEM_TO_HTTP_CODE
public static OAuthMessage getMessage(javax.servlet.http.HttpServletRequest request, java.lang.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 java.lang.String getRequestURL(javax.servlet.http.HttpServletRequest request)
public static void handleException(javax.servlet.http.HttpServletResponse response, java.lang.Exception e, java.lang.String realm) throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
public static void handleException(javax.servlet.http.HttpServletResponse response, java.lang.Exception e, java.lang.String realm, boolean sendBody) throws java.io.IOException, javax.servlet.ServletException
java.io.IOException
javax.servlet.ServletException
public static void sendForm(javax.servlet.http.HttpServletResponse response, java.lang.Iterable<? extends java.util.Map.Entry> parameters) throws java.io.IOException
java.io.IOException
public static java.lang.String htmlEncode(java.lang.String s)