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!! :(
client.auth_code.authorize_url(:redirect_uri => 'http:/0') only generates the url. I still need to redirect_to url.
Stupid me ...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.