Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.lyo.server.oauth.core
Class OAuthRequest

    java.lang.Object
      org.eclipse.lyo.server.oauth.core.OAuthRequest

    public class OAuthRequest

extends Object

Validates that a request is authorized. The request must contain a valid access token and pass `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());
     }

Author:
  Samuel Padgett

Constructor Summary
`OAuthRequest(javax.servlet.http.HttpServletRequest request)`

Method Summary
`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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OAuthRequest

    public OAuthRequest(javax.servlet.http.HttpServletRequest request)
                 throws net.oauth.OAuthException,
                        IOException

Throws:
  `net.oauth.OAuthException`
  `IOException`

Method Detail

### getHttpRequest

    public javax.servlet.http.HttpServletRequest getHttpRequest()

### setHttpRequest

    public void setHttpRequest(javax.servlet.http.HttpServletRequest httpRequest)

### getMessage

    public net.oauth.OAuthMessage getMessage()

### getAccessor

    public net.oauth.OAuthAccessor getAccessor()

### getConsumer

    public LyoOAuthConsumer getConsumer()

### validate

    public void validate()
                  throws net.oauth.OAuthException,
                         IOException,
                         javax.servlet.ServletException

  Validates that the request is authorized and throws an OAuth exception if not. The request must contain a valid access token and pass `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.

  Throws:
    `URISyntaxException`
    `IOException`
    `net.oauth.OAuthException` - if the request fails validation
    `javax.servlet.ServletException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013. All Rights Reserved.