Validating Okta Session - Getting Error for Singular User Skip to main content
https://support.okta.com/help/answers?id=9062a000000dfhvqag&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Joe FedorowiczJoe Fedorowicz 

Validating Okta Session - Getting Error for Singular User

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.
 
Valeriu HudeaValeriu Hudea (Okta, Inc.)

Hey , 

I have made an inquiry with our Developer side about the code and the flow, there are some followp questions about this :
1. In which browser is the error occurring? Is it a private window or a standard one? Is the 3rd party cookies allowed always in the browser in which the error occurs? 
What is the behavior in other browsers?
2. Could you check if 'sid' cookie is set in the request headers in the call /api/v1/users/me?

Best Regards

Joe FedorowiczJoe Fedorowicz
Hey, 

Pardon my naivety as I'm not really a programmer, but I'll do my best:

1) Both Chrome and IE. Standard Window. We disallow private windows but this is specific to this computer (I didn't include that). That user's credentials work on my machine. 3rd party cookies are allowed. 

2) Below is my request.

url: "https://DOMAIN.okta.com/api/v1/users/me",    
type: 'GET',    
dataType: 'json',    
contentType: 'application/json',    
xhrFields: {        
withCredentials: true     }