Module: YandexCloud::Auth::IamToken

Included in:
YandexCloud::Auth
Defined in:
lib/yandex_cloud/auth/iam_token.rb

Overview

Module for getting IAM token

Instance Method Summary collapse

Instance Method Details

#tokenObject

Get IAM token



6
7
8
9
10
11
12
# File 'lib/yandex_cloud/auth/iam_token.rb', line 6

def token
  # define params for request
  body = { 'yandexPassportOauthToken' => oauth_token }
  headers = { 'Content-Type' => 'application/json' }
  # make request
  self.class.post('/tokens', query: body, headers: headers).parsed_response
end