Module: B2::Authentication
- Defined in:
- lib/b2/authentication.rb
Class Method Summary collapse
Class Method Details
.authorize ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/b2/authentication.rb', line 4 def = { basic_auth: {username: B2.account_id, password: B2.application_key} } response = HTTParty.get("#{BASE_URI}b2_authorize_account", ) B2::Base.base_uri "#{response['apiUrl']}/b2api/v1/" B2::Base.headers 'Authorization' => response['authorizationToken'], 'Content-Type' => 'application/json' B2::Base..merge!(download_url: response['downloadUrl']) end |