moodlehq / moodle-enrol_oneroster

OneRoster Enrolment plugin for Moodle
GNU General Public License v3.0
3 stars 7 forks source link

[BUG] Getting the 'UnauthorizedError' / 'Invalid Token' error after one hour of running the OneRoter sync. #20

Open GopalSharma opened 2 years ago

GopalSharma commented 2 years ago

Bug description

Getting the 'UnauthorizedError' / 'Invalid Token' error after one hour of running the OneRoter sync. Scheduled task failed: Full sync of OneRoster (enrol_oneroster\task\full_sync),Unauthorized (https://douglascountysd-ga-v2.oneroster.com/ims/oneroster/v1p1/classes?limit=500&offset=3000): {"code":"UnauthorizedError","message":"Invalid Token"}

Expected behavior

Expected OneRoster plugin to regenerate a new token before expiring the current token. A token is getting expired after one hour(3600 seconds)

Moodle :

OneRoster Provider :

Additional information

This is the initial response from API. "{"access_token":"ortk164604816523694D2ED89111E385519**","token_type":"bearer","expires_in":3600,"scope":"roster-core.readonly roster-demographics.readonly resource.readonly"} A similar bug was posted earlier as well at #18

OneRoster sync fails while syncing big districts with big schools. Please, Let me know if more information is needed.

saxenapritesh commented 2 years ago

Hello @GopalSharma can you tell me where you got these values :

Token URL One Roster Root URL Authentication Client ID Authentication Secret

Can you tell me where you find these values as it doesn't provide any documentation for that.