I am trying to replicate functionality of cognito hosted ui sign in page(<https://docs.aws.amazon.com/cognito/latest/developerguide/login-endpoint.html>), but aws sdk does not provide any method that would take username,password and would return authorization code which could be used for obtaining access/id token. The initiateAuth and adminInitiateAuth only support implicit flow which returns directly access/id token. Is there any workaround for this, how to retrieve authorization code?

With best regards,
Jakub