I will try to keep the question as clear and direct as possible.
Problem: How can my custom webapp identify who just logged in so that they can fetch their Okta profile using API?
I am aware that Okta knows who just logged in due to claims that facebook sends to the OAuth client (Okta), but how will my app know the identity of the user who logged in?
Thanks,
Jatin
It depends on the OAuth2 flow you've chosen for your app, but the end state is getting an id_token from Okta which contains claims about the user that just logged in.
If you've set response_type=code
in your social auth url (/authorize), after Step 4 you'll get a code
query param in the redirect that you can then exchange for the id_token
using the /token endpoint.
Or, if you've set response_type=id_token
, you should already have the id_token
in the redirect - you just need to validate/decode it (more info here).