class EbanqApi::Auth

This class represents an auth functional of Ebanq REST Api.

Public Class Methods

new(client) click to toggle source

Declares an client instance.

# File lib/ebanq_api/blocks/auth.rb, line 13
def initialize(client)
  @client = client
end

Public Instance Methods

login(username, password, device_id, push_token = '') click to toggle source

Login a user for a new session /api/v1/auth/login

Attributes

  • username (required) - A valid username (String)

  • password (required) - A valid password (String)

  • device_id (required) - Device ID (String)

  • push_token - Push token (String)

# File lib/ebanq_api/blocks/auth.rb, line 26
def login(username, password, device_id, push_token = '')
  values = {
    username: username,
    password: password,
    device_id: device_id,
    push_token: push_token
  }

  @client.make_request :post, auth_path('login'), values
end
login_by(pin, device_id, push_token) click to toggle source

Login by PIN and Device ID /api/v1/auth/login_pin

Attributes

  • pin (required) - PIN code (String)

  • device_id (required) - Device ID (String)

  • push_token (required) - Push Token (String)

# File lib/ebanq_api/blocks/auth.rb, line 108
def login_by(pin, device_id, push_token)
  values = {
    pin: pin,
    device_id: device_id,
    push_token: push_token
  }
  @client.make_request :post,
                       auth_path('login_pin'),
                       values
end
login_with_token(token, secret) click to toggle source

Login a user for a new session using token and secret. Endpoint for third party clients. /api/v1/auth/login_token

Attributes

  • token (required) - A user token (String)

  • secret (required) - A user secret (String)

Examples

client.auth.login_with_token('token', 'secret')
# File lib/ebanq_api/blocks/auth.rb, line 49
def login_with_token(token, secret)
  values = {
    token: token,
    secret: secret
  }
  @client.make_request :post,
                       auth_path('login_token'),
                       values
end
logout() click to toggle source

Logout a user session /api/v1/auth/logout

# File lib/ebanq_api/blocks/auth.rb, line 61
def logout
  @client.make_request :post,
                       auth_path('logout')
end
logout_device(device_id) click to toggle source

Logout a user session by device id only /api/v1/auth/logout_device

Attributes

  • device_id (required) - Device ID (String)

# File lib/ebanq_api/blocks/auth.rb, line 72
def logout_device(device_id)
  values = {
    device_id: device_id
  }
  @client.make_request :post,
                       auth_path('logout_device'),
                       values
end
pass_reset_token(uid, timestamp, hashed_pass) click to toggle source

Process one time login link and return the pass_reset /api/v1/auth/user_pass_reset

Attributes

  • uid (required) - The uid of the user in the operation. (Number)

  • timestamp (required) - The timestamp value from the

reset password link. (Number)

  • hashed_pass (required) - The hashed pass value from

the reset password link. (String)

# File lib/ebanq_api/blocks/auth.rb, line 161
def pass_reset_token(uid, timestamp, hashed_pass)
  values = {
    uid: uid,
    timestamp: timestamp,
    hashed_pass: hashed_pass
  }
  @client.make_request :post,
                       auth_path('user_pass_reset'),
                       values
end
refresh_token(pin, device_id) click to toggle source

Get token (Refresh token) /api/v1/auth/token

Attributes

  • pin (required) - PIN code (String)

  • device_id (required) - Device ID (String)

# File lib/ebanq_api/blocks/auth.rb, line 141
def refresh_token(pin, device_id)
  values = {
    pin: pin,
    device_id: device_id
  }
  @client.make_request :post,
                       auth_path('token'),
                       values
end
request_new_password(name) click to toggle source

Request a new password, given a user name or e-mail address /api/v1/auth/request_new_password

Attributes

  • name (required) - A valid user name or e-mail address (String)

Examples

client.auth.request_new_password('John')
# File lib/ebanq_api/blocks/auth.rb, line 91
def request_new_password(name)
  values = {
    name: name
  }
  @client.make_request :post,
                       auth_path('request_new_password'),
                       values
end
reset_password(uid) click to toggle source

Password reset /api/v1/auth/uid/password_reset

Attributes

  • uid (required) - The id of the user (Number)

# File lib/ebanq_api/blocks/auth.rb, line 196
def reset_password(uid)
  values = {
    uid: uid
  }
  @client.make_request :post,
                       auth_path("#{uid}/password_reset"),
                       values
end
update_push_token(token, os_type) click to toggle source

Set push token api/v1/auth/push_token

Attributes

  • token (required) - Push token (String)

  • os_type (required) - OS type (String)

# File lib/ebanq_api/blocks/auth.rb, line 179
def update_push_token(token, os_type)
  values = {
    token: token,
    os: os_type
  }

  @client.make_request :post,
                       auth_path('push_token'),
                       values
end
update_user_pin(pin) click to toggle source

Set user pin /api/v1/auth/pin

Attributes

  • pin (required) - PIN code (String)

# File lib/ebanq_api/blocks/auth.rb, line 125
def update_user_pin(pin)
  values = {
    pin: pin
  }
  @client.make_request :post,
                       auth_path('pin'),
                       values
end