Google OAuth issues

Hi, we’ve got an error when using Google OAuth. We activated the free trial of the Mattermost Enterprise license and set up the Google OAuth as described here:

But now when trying to log in with a Google account, we get the Bad response from token request error.

mattermost.log contains:

{“timestamp”:“2025-03-17 15:02:50.264 Z”,“level”:“error”,“msg”:“Bad response from token request.”,“caller”:“web/context.go:123”,“path”:“/signup/google/complete”,“request_id”:“r4s7bodeo3npzjc56usjjc4raw”,“ip_addr”:“127.0.0.1”,“user_id”:“”,“method”:“GET”,“err_where”:“AuthorizeOAuthUser”,“http_code”:500,“error”:“AuthorizeOAuthUser: Bad response from token request., response_body={\n "error": "redirect_uri_mismatch",\n "error_description": "Bad Request"\n}, status_code=400, error=”}
{“timestamp”:“2025-03-17 15:02:53.797 Z”,“level”:“warn”,“msg”:“Error while creating session for user access token”,“caller”:“app/session.go:113”,“error”:“createSessionForUserAccessToken: Invalid or missing token., resource "UserAccessToken" not found, id: token=”}

while redirect_uri match our website url:

The mattermost is running on the Ubuntu Server.

Thanks for reaching out, Vyacheslav! The error indicates a possible redirect_uri mismatch. Please double-check that the redirect URI from your Mattermost OAuth settings matches exactly what’s configured in the Google API Console (e.g., https://chat.flf.org/signup/google/complete). You can find setup details in our Google Single Sign-On documentation. Let us know if you need more help!

Hi John, thank you for the response. I tried it in the first place and it did not work.