使用 rails oauth2 插件覆盖站点 url
Site url getting overridden using rails oauth2 plugin
我正在使用 ruby oauth2 gem
我的网站 URL 作为
site = "https://192.168.5.15:9443/oauth2/authorize"
但是一旦我打电话
client.auth_code.authorize_url(:redirect_uri => redirect_uri)
我的URL改成了
https://192.168.5.15:9443/oauth/authorize?client_id=J7H_LoEIdaf9aVXF_opqtVMLgwoa&redirect_uri
所以我的 oauth2/authorize
被 oauth/authorize
取代了
有什么办法可以解决这个问题吗?
提前致谢。
您需要传递 :authorize_url
属性。
require 'oauth2'
client = OAuth2::Client.new('client_id', 'client_secret', :authorize_url => '/oauth2/authorize', :site => 'https://192.168.5.15:9443')
我正在使用 ruby oauth2 gem
我的网站 URL 作为
site = "https://192.168.5.15:9443/oauth2/authorize"
但是一旦我打电话
client.auth_code.authorize_url(:redirect_uri => redirect_uri)
我的URL改成了
https://192.168.5.15:9443/oauth/authorize?client_id=J7H_LoEIdaf9aVXF_opqtVMLgwoa&redirect_uri
所以我的 oauth2/authorize
被 oauth/authorize
有什么办法可以解决这个问题吗?
提前致谢。
您需要传递 :authorize_url
属性。
require 'oauth2'
client = OAuth2::Client.new('client_id', 'client_secret', :authorize_url => '/oauth2/authorize', :site => 'https://192.168.5.15:9443')