Replies: 5 comments 10 replies
-
IMO, your best bet is to define your own fastapi-users/fastapi_users/router/oauth.py Lines 100 to 147 in baca17d As you can see, the first step is to call |
Beta Was this translation helpful? Give feedback.
-
Thanks for this! This should be in the docs! |
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to generate REFRESH TOKEN from Google Cloud Console for my Python code. Also, I already have client_id and client_secret. could you help me generate REFRESH TOKEN from Google Cloud Console or any other way? My 'Jason code' is as 'client_secret.json' as file name: Load the client secret fileclient_secret_file = "client_secret.json" Load the credentials filewith open("credentials.json", "r") as f: Create the credentials objectcreds = Credentials.from_authorized_user_info(info=credentials_data) Print the refresh tokenprint("Refresh Token:", creds.refresh_token)` Is my activities fine? |
Beta Was this translation helpful? Give feedback.
-
thanks! |
Beta Was this translation helpful? Give feedback.
-
for anyone out there
and then in your FE just use the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I implemented the Google OAuth2 Router as shown in the documentation, and created everything necessary on the Google Cloud Console (ID, Secret, etc.). In my Database, my User Model also requires the first and last name of each user which works excellently with a regular register endpoint. Is there any way to access the Google User's last and first name information in "FastAPI Users"?
For now, I am simply getting Validation Errors as soon as the OAuth endpoint is used, due to no first and last name being provided.
Any Help is greatly appreciated!
I was able to modify the Google OAuth Client to extract also the first and last name as such:
With a lot of reverse engineering, it is kind of possible to at least create an account using google utilizing first and last name, but is there any way it is supported by the package without me having a local fork of the package or something ?
Beta Was this translation helpful? Give feedback.
All reactions