Relative Content

Tag Archive for python-3.xgoogle-oauthfastapi

How do I fix a “CSRF Warning! State not equal in request and response.” error when trying to log in with Google using FastAPI?

I get redirected fine to Google’s consent screen, but after consenting, I get hit with the authlib.integrations.base_client.errors.MismatchingStateError: mismatching_state: CSRF Warning! State not equal in request and response. error. The weird part is I’ve seen this exact way of doing it a few different times, and I follow the steps precisely, but in my case it doesn’t work for some reason.