Class: WorkAuthClient::PasswordRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/work_auth_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id:, client_secret:, username:, password:) ⇒ PasswordRequest

Returns a new instance of PasswordRequest.



80
81
82
83
84
85
# File 'lib/work_auth_client.rb', line 80

def initialize(client_id:, client_secret:, username:, password:)
  self.client_id = client_id
  self.client_secret = client_secret
  self.username = username
  self.password = password
end

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



78
79
80
# File 'lib/work_auth_client.rb', line 78

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



78
79
80
# File 'lib/work_auth_client.rb', line 78

def client_secret
  @client_secret
end

#passwordObject

Returns the value of attribute password.



78
79
80
# File 'lib/work_auth_client.rb', line 78

def password
  @password
end

#usernameObject

Returns the value of attribute username.



78
79
80
# File 'lib/work_auth_client.rb', line 78

def username
  @username
end

Instance Method Details

#as_jsonObject



87
88
89
90
91
92
93
94
95
# File 'lib/work_auth_client.rb', line 87

def as_json
  {
    client_id: client_id,
    client_secret: client_secret,
    username: username,
    password: password,
    grant_type: 'password',
  }
end