I gone through several forums to understand how to get stateToken. but none of them provided straight forward answer.
I am trying to test following
curl -v -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"stateToken":"00BClWr4T-mnIqPV8dHkOQlwEIXxB4LLSfBVt7BxsM",
"username": "dade.murphy@example.com",
"password": "correcthorsebatterystaple"
}' "https://${yourOktaDomain}/api/v1/authn"
I am not sure what I have to provide for stateToken
A state token is ephemeral token that encodes the current state of an authentication transaction.
You can find more details here:
It is generated during the authentication (AuthN) process, and gets converted to a session token once the user has been authenticated. AuthN end point details here:
Then I took session token as you mentioned and passed as input for stateToken. Following are the results
End point : https://${yourOktaDomain}/api/v1/authn
Request :
{
“stateToken”:“20111OtQlIstE4AxrG_VrClO53wrvUTbVZFGepiSOO0HfO9wj5-C3v8”,
“username”: “dade.murphy@example.com”,
“password”: “correcthorsebatterystaple”
}