Is there a way to configure and utilize the Amazon Cognito Identity SDK for JavaScript in order to implement the Authorization Code Grant flow instead of the Implicit Grant flow? It appears that the SDK only supports Implicit Grant, which means that a Client Secret is not generated when creating an AppClient and the user's credentials are exchanged directly for JWTs with an API call.
By using the Amazon Cognito Hosted UI options, the redirect after successful authentication with user credentials includes the authorization code, which can then be sent to a backend server/API to exchange it for JWTs at the Token endpoint.
Instead of retrieving the user's JWTs directly from Cognito using this library/SDK, is it possible for it to simulate the Hosted UI flow and return an authorization code?