You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I currently am trying to configure logging in with google via fastapi users, I have in my backend the following
google_oauth_client = GoogleOAuth2(GOOGLE_CLIENT_ID_DB, GOOGLE_CLIENT_SECRET, scopes=["openid", "email", "profile"])
Also my react js frontend does the following
const loginWithGoogle = useCallback(() => {
const base = getApiBaseUrl();
if (!base) return;
window.location.href = ${base}/auth/google/authorize;
}, []);
For some reason when I continue with the flow I get a 400 Bad Request error at the /auth/google/callback endpoint with detail
{"detail":"OAUTH_INVALID_STATE"}
I've also tried setting csrf_token_cookie_secure=False since I am testing on local host.
I would love if someone could guide me through this as I've been stuck on it for a while, thank you!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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 currently am trying to configure logging in with google via fastapi users, I have in my backend the following
google_oauth_client = GoogleOAuth2(GOOGLE_CLIENT_ID_DB, GOOGLE_CLIENT_SECRET, scopes=["openid", "email", "profile"])
Also my react js frontend does the following
const loginWithGoogle = useCallback(() => {
const base = getApiBaseUrl();
if (!base) return;
window.location.href =
${base}/auth/google/authorize;}, []);
For some reason when I continue with the flow I get a 400 Bad Request error at the /auth/google/callback endpoint with detail
{"detail":"OAUTH_INVALID_STATE"}
I've also tried setting csrf_token_cookie_secure=False since I am testing on local host.
I would love if someone could guide me through this as I've been stuck on it for a while, thank you!
All reactions