Getting Current User in Custom App Skip to main content
https://support.okta.com/help/answers?id=9062a000000xzl8qag&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 

Getting Current User in Custom App

Hello, 

I am writing a custom app and am using the Okta API to pass some information to it. I need to know the best way to get the login for the currently logged in user. I'm utilizing a "Bookmark" app and link to redirect to a URL. The "Get Current User" call only returns me, since I set up the API key. I cannot figure out how to do "Get Current Session." 

Any help would be much appreciated. I am not that great at this so bear with me. Thanks.
Costel CurcaCostel Curca (Okta, Inc.)
Hello, my name is Costel from Okta support.
The best place to start is using our primary auth API with a public application (that is setup with the API token generated from Okta).
As described under "Primary Authentication with Public Application"
You can get the Current user by using this API call that returns a session token at redirects the user to a defined URL.


curl -v -X POST \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "username": "dade.murphy@example.com", "password": "correcthorsebatterystaple", "relayState": "/myapp/some/deep/link/i/want/to/return/to", "options": { "multiOptionalFactorEnroll": false, "warnBeforePasswordExpired": false } }' "https://${org}.okta.com/api/v1/authn"