Class: OAuth2::Strategy::Password
- Defined in:
- lib/oauth2/strategy/password.rb
Overview
The Resource Owner Password Credentials Authorization Strategy
Instance Method Summary collapse
- 
  
    
      #authorize_url  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Not used for this strategy. 
- 
  
    
      #get_token(username, password, params = {}, opts = {})  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Retrieve an access token given the specified End User username and password. 
Methods inherited from Base
Constructor Details
This class inherits a constructor from OAuth2::Strategy::Base
Instance Method Details
#authorize_url ⇒ Object
Not used for this strategy
| 12 13 14 | # File 'lib/oauth2/strategy/password.rb', line 12 def raise(NotImplementedError, "The authorization endpoint is not used in this strategy") end | 
#get_token(username, password, params = {}, opts = {}) ⇒ Object
Retrieve an access token given the specified End User username and password.
| 21 22 23 24 25 26 27 28 | # File 'lib/oauth2/strategy/password.rb', line 21 def get_token(username, password, params = {}, opts = {}) params = { "grant_type" => "password", "username" => username, "password" => password, }.merge(params) @client.get_token(params, opts) end |