Hello,
I’m trying to authenticate a user in my web application using the primary authentication API endpoint (https://developer.okta.com/docs/reference/api/authn/#primary-authentication).
This is my POST body:
{
"username": "{{username}}",
"password": "{{password}}",
"audience": "{{clientId}}"
}
And this is the response I get (both in Postman and when I run my application):
{
"errorCode": "E0000002",
"errorSummary": "The request was not valid: api.authn.error.AUDIENCE_NOT_SUPPORTED",
"errorLink": "E0000002",
"errorId": "oae3HUV1AwUSBeBhPYIPEUomA",
"errorCauses": []
}
The request works fine without the audience parameter. However, it allows the user to continue the sign-in process even though they are not assigned to the application.
Is it wrong to assume that the audience parameter is for the application client id? If so, what is the proper way to check if the user is assigned to the application when authenticating?
Thank you in advance!