Thank you for posting this in Microsoft Q&A.
I understand you are trying to implement the Native authentication REST API reference - email OTP with Entra, getting the "AADSTS90023: Invalid STS request" error with Bad request response code (400).
Basically, a 400 Bad Request error occurs when a request sent to the website server is incorrect or corrupt, and the server receiving the request cannot understand it.
Here are a few things you can check to troubleshoot this issue:
1.Verify that the request is being sent to the correct endpoint. The endpoint for the Native authentication REST API reference - email OTP with Entra is https://login.microsoftonline.com/enterpriseregistration.windows.net/enrollmentserver/issueotp
. Make sure that the request is being sent to this endpoint.
2.Verify that the user's email address is valid and that it is associated with a valid Entra account.
3.Check that the request is properly formatted. The request should include the required parameters and headers.
4.Check that the client application is properly registered in Azure Active Directory and that it has the necessary permissions to call the authentication service.
Hope this helps. Do let us know if you any further queries.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.
Thanks,
Navya.