OAuthSession.authorizeRequest

Authorize an HTTP request using this session's token.

When implementing a REST interface client for a service using OAuth, you may want to set vibe.web.rest.RestInterfaceClient.requestFilter to a delegate to this method, so authorization will be handled automatically.

This implementation only supports, and blindly assumes, the 'bearer' token type. Subclasses should override this if support for other token types is required.

If this instance is mutable and the access token has expired and a refresh token is available, a new access token will be requested automatically by a call to refresh.

  1. void authorizeRequest(HTTPClientRequest req)
  2. void authorizeRequest(HTTPClientRequest req)
    class OAuthSession
    const
    void
    authorizeRequest
    (
    scope HTTPClientRequest req
    )

Parameters

req HTTPClientRequest

The request to be authorized

Throws

OAuthException if this session doesn't have any access token, or the access token has expired and cannot be refreshed.

Meta