public class OAuthRequest extends Object
OAuthValidator
tests. To change the validator
used, call OAuthConfiguration.setValidator(OAuthValidator)
.
Usage:
try { OAuthRequest request = new OAuthRequest(httpRequest); request.validate(); } catch (OAuthException e) { // Request failed validation. Send an unauthorized response. OAuthServlet.handleException(httpResponse, e, OAuthConfiguration .getInstance().getRealm()); }
Constructor and Description |
---|
OAuthRequest(javax.servlet.http.HttpServletRequest request) |
Modifier and Type | Method and Description |
---|---|
net.oauth.OAuthAccessor |
getAccessor() |
LyoOAuthConsumer |
getConsumer() |
javax.servlet.http.HttpServletRequest |
getHttpRequest() |
net.oauth.OAuthMessage |
getMessage() |
void |
setHttpRequest(javax.servlet.http.HttpServletRequest httpRequest) |
void |
validate()
Validates that the request is authorized and throws an OAuth exception if
not.
|
public OAuthRequest(javax.servlet.http.HttpServletRequest request) throws net.oauth.OAuthException, IOException
net.oauth.OAuthException
IOException
public javax.servlet.http.HttpServletRequest getHttpRequest()
public void setHttpRequest(javax.servlet.http.HttpServletRequest httpRequest)
public net.oauth.OAuthMessage getMessage()
public net.oauth.OAuthAccessor getAccessor()
public LyoOAuthConsumer getConsumer()
public void validate() throws net.oauth.OAuthException, IOException, javax.servlet.ServletException
OAuthValidator.validateMessage(OAuthMessage, OAuthAccessor)
checks using the validator set in the OAuthConfiguration
.
If the request fails validation, you can use
OAuthServlet.handleException(javax.servlet.http.HttpServletResponse, Exception, String)
to send an unauthorized response.
URISyntaxException
IOException
net.oauth.OAuthException
- if the request fails validationjavax.servlet.ServletException
Copyright © 2018. All Rights Reserved.