'AWS Cognito login to return as JSON
I have this link : https://{application}.auth.us-east-1.amazoncognito.com/oauth2/authorize?response_type=token&client_id={clientid}&redirect_uri=http://localhost
Above link will direct me to login page of Cognito. How do I return the respond as JSON so I can set up the token in cookie or indexedDB ?
Solution 1:[1]
I've been researching Cognito.
The OpenId URLs like /oauth2/authorize
are part of the Hosted UI. The redirected requests are meant to go to a browser, and you can't configure these to use JSON.
What you will be more interested in is Cognito's API. Requests and responses are all JSON; for example, the InitiateAuth
endpoint is analogous to the /authorize
endpoint of the Hosted UI.
The part I'm struggling with is that the Hosted UI supports OIDC features like PKCE for sending an authorization code to a server to securely pass the identity. The API doesn't seem to have anything like this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | kris larson |