Method: OAuth2::Strategy::Password#get_token

Defined in:
lib/oauth2/strategy/password.rb

#get_token(username, password, params = {}, opts = {}) ⇒ Object

Retrieve an access token given the specified End User username and password.

Parameters:

  • username (String)

    the End User username

  • password (String)

    the End User password

  • params (Hash) (defaults to: {})

    additional params



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