intridea/oauth2 — Issue #77: using auth token from different url than authentication
Author: icambron
Created: 2011-10-09 05:49:49+00:00
State: open

I'm using the GData API, and it expects me to authenticate at `http://accounts.google.com` and then use the token at the appropriate API URL, which is totally different. In my case, that's `http://google.com/calendar`. I'm not sure how to do that, though, since everything gets appended to the `site` URI.

```ruby
get '/login' do
redirect client.auth_code.authorize_url(
:redirect_uri => CALLBACK_URL,
:scope => 'https://www.google.com/calendar/feeds')
end

get '/callback' do
token = client.auth_code.get_token(params[:code], :redirect_uri => CALLBACK_URL)
#HOW DO I MAKE THIS RELATIVE TO http://google.com ?
puts token.get('/calendar/feeds/default/owncalendars/full');
end

def client
OAuth2::Client.new(
CLIENT_ID, CLIENT_SECRET,
:site => 'https://accounts.google.com',
:token_url => '/o/oauth2/token',
:authorize_url => '/o/oauth2/auth')
end
```