itamart / moodle-block_mhaairs

0 stars 5 forks source link

Identity type ignored in GetUserInfo #8

Closed itamart closed 8 years ago

itamart commented 9 years ago

From Vadim: Authorization connector has “identity_type” property, which is not being treated in plugin (GetUserInfo entry point). If its value is “internal”, the plugin should assume the user id being passed is an internal user id, otherwise – user name. Similar thing exists in gradebook for reference, except that gradebook also allows “lti” value.

RanQTGIT commented 9 years ago

This issue still exists in the updated plugin

itamart commented 9 years ago

Test scenario?

RanQTGIT commented 9 years ago

do you have access to MHCampus UI?

  1. Change Authorization Connector's identity_type property to "internal"
  2. Test Connector, provide a real internal user ID (e.g. 26) Result: response received from remote server:{"status":1,"user":null,"courses":[],"message":"error: user with username '26' not found"}]]>

(Same test with same property value succeeds with a real external ID value (e.g. qtstud3))

itamart commented 9 years ago

What is the token user id in your test case? With identity type internal the service expects the token user id to be the internal id. If you create the token with username and the username is different from the internal userid, as is likely to be the case, the request will fail. I'm adding a test client for the get user info service.

RanQTGIT commented 9 years ago

where do you find the token user id?

itamart commented 9 years ago

The token user id is contained in the token that is passed to the service call. If the test is via the UI, the token is generated by the Connnector. We need Vadim to advise how the token is created on the Connector side.