I'm trying to use the forceLogouts LP API call from within a course widget. But I keep getting response.status of 403.
I'm doing this so my Single Sign On Users will get forced logged out from Brightspace pulse which would normally hold their login for the 30 day tokens they are granted in Pulse. We want to just lock the Microsoft SSO and not change the student status on their courses. Bonus is we can manually force logouts of the system. Any help would be appreciated.
API Call:
PUT /d2l/api/lp/(version)/forceLogout/(userId)¶
This api call uses scope of sessions:session:delete
I've verified the API url and the userid exist:
version =1.49
userId is being pulled from subsequent enrollment API call and have been confirmed in the debugger to be valid in the API url at time of status !=200..
My code runs:
const ForceLogoutUrl = /d2l/api/lp/${version}/forceLogout/${userId};
const response = await fetch(ForceLogoutUrl, { method: 'PUT'});
if (response.status !== 200) {
console.info(Fetch forcelogout error: url: available(${response.url}) status code: ${response.status}.);
return null;
}