Use-case: user logs in to my app using ORCID oauth; user logs out of session on my server and is automatically signed out of ORCID session
Plain javascript implementation:
fetch('https://sandbox.orcid.org/userStatus.json?logUserOut=true',{ mode: 'no-cors', headers: {Accept: 'application/json'}, credentials: 'include'}) .then(function (response) { return response.json(); }) .then(function (data) { if (data.loggedIn === false) { document.getElementById('logOutAttemptResult').innerText = 'The javascript fetch method was used to request https://sandbox.orcid.org/userStatus.json?logUserOut=true'; } }) .catch(function (err) { console.log(err); });
This solution works as of April 8, 2019.
In order to test this, please ensure that you are starting with a clean slate:
The test
Expected outcome is that from this page you should be able to force an ORCID signout.
If, after running through this process, the page at https://sandbox.orcid.org/my-orcid allows you to edit the profile you are NOT logged out.
:: Diagnostics ::
Your loggedIn status: no test has been run