Logged in via widget, /me session in PHP not current logged in user

When I login with the widget and then run the curl command via PHP to “https://${yourOktaDomain}/api/v1/users/me” I expect to get the logged in users data, instead I am getting a generic account user (assuming it’s the user linked to the API token)

Is there a way to get the logged in users information without waiting on the widget to return it via JavaScript? (which waits until the page is loaded)

Currently I am making an AJAX call to another page AFTER the page fully loads to set the user session, but that requires another refresh after session is set

Hi @Kender

You can do a cURL request from php using the user’s ID, short name or full username and retrieve his profile information.

I understand that, but I am trying to fetch the logged in user, not knowing those yet, once I have them I can get that information with those calls, yes, and when I get it for the first time I put that information into my _SESSION variable. But the first time I need to get his information, I need to wait until the JS function runs, which is after the page is fully loaded, so a delay.