Method: Dnsimple::Client::Oauth#authorize_url
- Defined in:
- lib/dnsimple/client/oauth.rb
#authorize_url(client_id, options = {}) ⇒ String
Gets the URL to authorize an user for an application via the OAuth2 flow.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/dnsimple/client/oauth.rb', line 31 def (client_id, = {}) site_url = client.base_url.sub("api.", "") url = URI.join(site_url, "/oauth/authorize?client_id=#{client_id}") = .merge(response_type: "code") .each do |key, value| url.query += "&#{key}=#{value}" end url.to_s end |