Reputation: 1369
I have no idea how to use this oauth2 gem
The Usage Examples confuse me.
In token = client.auth_code.get_token('authorization_code_value', :redirect_uri => 'http://localhost:8080/oauth2/callback', :headers => {'Authorization' => 'Basic some_password'})
Shouldn't 'authorization_code_value' is a part of the response? How could I get it before the request is made?
My code so far:
require 'oauth2'
class Apis::OauthsController < ApplicationController
def create
client = OAuth2::Client.new('id', 'secrete', :token_url => '/dialog/oauth?', :site => 'https://www.facebook.com')
client.auth_code.authorize_url(:redirect_uri => 'http://localhost:3000')
respond_to do |format|
format.json { render json: [], status: :ok }
end
end end
Why client.auth_code.authorize_url(:redirect_uri => 'http://localhost:3000')
is not sending request to facebook?
Eventually, I'm not connecting to fb, I just use it as an experiment. That's why I don't use their sdk.
Is there any example I could follow?
Please help!! :(
Upvotes: 0
Views: 878
Reputation: 1369
client.auth_code.authorize_url(:redirect_uri => 'http:/0') only generates the url. I still need to redirect_to url.
Stupid me ...
Upvotes: 1