How can i generate a state token Skip to main content
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Sonal RoutSonal Rout 

How can i generate a state token

James FloresJames Flores (Okta, Inc.)
Hi Sonal, 

I am afraid that statment is a bit vauge. Can you clarify which SDK you are using? I am assuming you are using an SDK of sorts or perhaps this is in the OIDC space. Nonetheless, your best starting point for SDK and OIDC related questions is

If this is regards to an API token then you can find more informaiton here,
Sonal RoutSonal Rout
Hi James, I am trying to use the OCTA API to Enroll Okta SMS Factor but getting an error due to the state token. Could you please help me here. Thanks and Regards, Sonal T: 972-453-7124 M: 1-972-948-3272
James FloresJames Flores (Okta, Inc.)
Can you post the full message here? In reviewing the documentation and testing in Postman it seems the token used is the normal API token as mentioned in the above link. This is the doucmentation on Enrolling in SMS via the API found here

It shows the sample code of:

H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: SSWS ${api_token}" \
-d '{
"factorType": "sms",
"provider": "OKTA",
"profile": {
      "phoneNumber": "+1-555-415-1337"
}' "https://${org}"

In which the API token aquired from the Okta tenant is set to the ${api_token} varaible. If you have done this already and verified your token is still valid and still see an error the full error posted here would be most helpful. 
Sonal RoutSonal Rout
Hi James, Thanks for your help. Could you please let me know what is the below highlighted value for the URL https://${org}" Below is my request I am trying. Url- Post data
James FloresJames Flores (Okta, Inc.)
This value (00u15s1KDETTQMQYABRL) is essentiall the user ID for the user. The API calls do not use email or UPN to find users, this is what you must specify the user ID. If you run a GET for the users in the org you should be able to pull this ID,