Integrating AWS Cognito with Frappe: How to Bypass Login Screen Using Authorization Code?

Hi everyone,

I’m working on integrating AWS Cognito with Frappe to allow users to sign in using their Google credentials. Here’s what I’ve done so far:

  1. Configured AWS Cognito with Google as an identity provider.
  2. Generated a sign-in URL that allows users to log in with Google.
  3. After login, AWS Cognito redirects the user to a callback URL with an authorization_code as the value for the code= query parameter.

My goal is to have the callback URL point to Frappe, bypass the login screen, and seamlessly log the user into the application.

What I Need Help With:

  • How do I set up Frappe to handle the authorization_code provided by AWS Cognito?
  • What configurations or code changes are necessary for Frappe to exchange the authorization_code for a token and bypass the login screen to log the user in?

Any guidance or examples would be greatly appreciated!

Thanks in advance!

Base URL: https://your URL/
Authorize URL: /authorize
Access Token URL: /token
Redirect URL: https://yourdomain/api/method/frappe.integrations.oauth2_logins.custom/
API Endpoint: https://AWS URL/oauth2/userInfo

use a js to hide and bypass login page? Frappe OAuth - How to disable native login form - #4 by revant_one. In case of custom app you can even override login.html or make your own auth.html

Related: Issues with OAuth Bearer Token Validation When Using Keycloak for API Access - #2 by revant_one