Skip to content

Commit

Permalink
R token
Browse files Browse the repository at this point in the history
  • Loading branch information
gridanjbf committed Apr 16, 2024
1 parent 6cba52a commit 355dab1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/sharepoint/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ def fetch
tenant_id: config.tenant_id,
cert_name: config.cert_name,
auth_scope: config.auth_scope
}
}.to_json

headers = headers = {'Content-Type' => 'application/json'}

ethon = Ethon::Easy.new(config.token_url, :post, { body: auth_request }, followlocation: true)
ethon = Ethon::Easy.new(config.token_url, :post, body: auth_request, headers: headers, followlocation: true)
ethon.perform

raise InvalidTokenError.new(ethon.response_body.to_s) unless ethon.response_code == 200
Expand Down

0 comments on commit 355dab1

Please sign in to comment.