Cognito authorization code grant flow for custom UI
There's no API that supports this functionality. It would be great if initiateAuth
and adminInitiateAuth
could respond with authorization code.
One of the workarounds suggested by AWS is for your backend to send a POST request with login and password to the login page in the hosted UI. I wouldn't recommend this solution though. It's unnecessarily complicated and doesn't work with MFA challenges. It may also impact brute force attack detection as well as the Advanced Security features because the original IP address of the user is masked by your backend IP address.