cancel
Showing results for 
Search instead for 
Did you mean: 
nastya_zzz
Surveyor

OAuth2. 401 Unauthorized

Hello!

I'm doing OAuth2 authorization and I have one problem.

I'm getting bearer token using grant_type: authorization_code:

 

{
  "grant_type": "authorization_code",
  "client_id": "11111111111",
  "client_secret": "444444444" ,
  "redirect_uri": "https://mysite/ims/lti/v13/auth/",
  "code": "1234567890",
  "state": "kkk444555",
  "scope": "https://purl.imsglobal.org/spec/lti-ags/scope/lineitem https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly"
}

 

Then, in canvas I select 'External tool' and send a response for the canvas:

 

RestClient::Request.execute(
     method: :get,
     url: 'mysite/api/lti/authorize_redirect',
     payload: payload.to_json,
     headers: { content_type: 'application/json', Authorization: "Bearer 123456789"},
     verify_ssl: OpenSSL::SSL::VERIFY_NONE)

 


but I am getting 'Reason error. 401 Unauthorized'

Maybe you know why this error occurs?

Tags (1)
0 Kudos
0 Replies