Hello everyone, I can use n8n in localhost. I want to upload image in drive but i can face this error: Error 400: redirect_uri_mismatch You can’t sign in to this app because it doesn’t comply with Google’s OAuth 2.0 policy. If you’re the app developer, register the redirect URI in the Google Cloud Console. Request details: redirect_uri=http://localhost:5678/rest/oauth2-credential/callback flowName=GeneralOAuthFlow
Describe the problem/error/question
error in uploading file on drive
Access blocked: This app’s request is invalid
What is the error message (if any)?
Error 400: redirect_uri_mismatch
You can’t sign in to this app because it doesn’t comply with Google’s OAuth 2.0 policy.
Can we also doublecheck the OAuth settings in the Google Console look like this (also check for any trailing whitespaces or other symbols that shouldn’t be there):
Ok, one more thing to check - can we make sure the Google account you set up in the Console is the same as the Google account you are providing in the n8n credentials page, when the login pop-up window appears?
Hi, @Dhruv29 is your app in Google Cloud Console published or no? If not, you can either do so, or alternatively, you can add yourself as a test user, which might help with the error
The problem is that google’s auth doesnt know what localhost is since you’re hosting n8n on your machine and there is no public IP attached for google to do the redirect url. You will need to host n8n on a cloud provider somewhere or start n8n using tunnel mode to get a temporary public dns and ip. Only problem here is that everytime you restart n8n, it will generate a new dns name and ip which will break your google auth again.
localhost is fine, the way it works is after authentication and consent user is redirected to redirect_uri along with the code and state, where localhost is ok, if this is where the app can verify the state.