How to log in to Frappe using Google Oauth and return Frappe’s access_token and refresh_token instead of logging in directly to Frappe through Google
- setup Social Login Key with Google as provider
- add OAuth Client and initiate flow with it.
- on login page, if you click Google button you’ll login with Google yet get the Frappe’s access token.
Is this what you need?
Yeah, I’ve tried this method of yours, but I need to do it in a mobile app, so this is not appropriate because when I tested it, Google did not allow this, prompting that access is blocked. Not compliant with OAuth 2.0 security specification.
So finally I use to get Google authorization after redirecting the specified API to get the google id_token, parse to get email, use the state corresponding to email way to deposit into the frappe cache, after the cell phone APP only need to provide the state request frappe.local.login_manager. login_as API, read the state corresponding to email in the frappe cache can get frappe session, and then request frappe oauth client to get the code, and then use the code to get the access_token can be solved!