Hello,
I’m having a problem with a specific user. I’ve cleared all cache and reset everything but cannot wrap my head around it. I’m using the following endpoint: https://harmelin.okta.com/api/v1/users/me
This is only happening to this one user. She is getting this error when I navigate to the ME endpoint.
{“errorCode”:“E0000005”,“errorSummary”:“Invalid session”,“errorLink”:“E0000005”,“errorId”:“oae9a-DlGSZST6XYfSsFdUsOg”,“errorCauses”:}
There is some logic in my app that checks if the user is logged in to Okta and, if they aren’t, they take them to the login page with a bookmark redirect. I just get sent right back to the redirect.
If I sign out and sign back in, going to the endpoint will yield the correct results…but attempting to use the app changes it to the error.
My relevant code is below:
<script>
var settings = {
url: "https://DOMAIN.okta.com/api/v1/users/me",
type: 'GET',
dataType: 'json',
contentType: 'application/json',
xhrFields: {
withCredentials: true
},
success: function (data) {
// alert(JSON.stringify(data));
},
error: function(err){
window.location.href = "https://DOMAIN.okta.com/home/bookmark/0oadano3z5BduiJwm0x7/2557";
}
}
jQuery.ajax(settings).done(function (success) {
// console.log(success); // debugging
var raw = success.profile.login;
var email = raw.toLowerCase();
var $login = email.replace(/@[^@]+$/, '');
jQuery('#write-data').append($login);
// console.log(jQuery('.tableauViz')); // debugging
jQuery('#username_filter').attr('value', 'theUsername='+$login);
// load xxxx viz javascript to turn placeholder into xxxx dashboard
var script = document.createElement('script');
script.type='text/javascript';
script.src = 'http://dashboard1.DOMAIN.com/javascripts/api/viz_v1.js';
jQuery('body').append(script);
})
</script>
Any insight would be great. Thanks.