Class: OAuth2::Grant::Implicit
- Defined in:
- lib/oauth2/grant/implicit.rb
Overview
Implicit Grant
Instance Attribute Summary
Attributes inherited from Base
#authorize_path, #client_id, #client_secret, #connection, #device_path, #host
Instance Method Summary collapse
-
#get_token(opts = {}) ⇒ Object
Retrieve an access token given the specified client.
- #response_type ⇒ Object
-
#token_path(params = {}) ⇒ Object
Generate a token path using the given parameters .
- #token_url(params = {}) ⇒ Object
Methods inherited from Base
Methods included from UrlHelper
#build_url, #generate_timestamp, #generate_urlsafe_key, http_basic_encode, #to_query
Constructor Details
This class inherits a constructor from OAuth2::Grant::Base
Instance Method Details
#get_token(opts = {}) ⇒ Object
Retrieve an access token given the specified client.
28 29 30 31 32 33 34 |
# File 'lib/oauth2/grant/implicit.rb', line 28 def get_token(opts={}) opts[:params] ||= {} opts[:params].merge!(token_params) opts[:authenticate] ||= :headers method = opts.delete(:method) || :get make_request(method, @token_path, opts) end |
#response_type ⇒ Object
7 8 9 |
# File 'lib/oauth2/grant/implicit.rb', line 7 def response_type "token" end |
#token_path(params = {}) ⇒ Object
Generate a token path using the given parameters .
14 15 16 17 |
# File 'lib/oauth2/grant/implicit.rb', line 14 def token_path(params={}) params = params.merge(token_params) "#{@authorize_path}?#{to_query(params)}" end |
#token_url(params = {}) ⇒ Object
19 20 21 22 |
# File 'lib/oauth2/grant/implicit.rb', line 19 def token_url(params={}) params = params.merge(token_params) build_url(host, :path => , :params => params) end |