
VeerendraB.56949 (Customer) asked a question.
We are using OKTA for SSO flows from browser.
This works fine.
We got new requirement to support this SSO flow from non-UI based flow.
To achieve this we have captured requests between OKTA and browser so that we can simulate the flow. In that process we are sending authentication request /api/v1/authn with required POST data but we are getting 400 bad reqeust.
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
</body>
</html>
There is not much useful data to understand the cause of the issue.
Can some one help whether it is allowed to send the request directly like this.

Hi Veerendra,
Can you check if you are passing following headers ?
Accept : application/json
Content-Type: application/json
It should be simple username & password in the request body. Make sure that multiOptionalFactorEnroll should be set to true as shown below request body.
{
"username": "sandeep_khurana@live.com",
"password": "XXXXXXXX",
"options": {
"multiOptionalFactorEnroll": true,
"warnBeforePasswordExpired": true
}
}
Thanks Sandeep for your help. It worked. I thought options are optional hence did not pass before.