Found error after OAuth login

  • What Grafana version and what operating system are you using?
    RHEL8.6 Grafana 9.6

  • What are you trying to achieve?
    Find more post for solve this problem but not match.

  • How are you trying to achieve it?
    Tacking network it allow and can access.

  • What happened?
    Can not use OAuthLogin ? error

logger=context userId=0 orgId=0 uname= t=2023-01-24T14:52:51.28735047+07:00 level=error msg=login.OAuthLogin(NewTransportWithCode) error="Post \"https://accounts.google.com/o/oauth2/token\": dial tcp 172.217.25.205:443: connect: connection timed out"
logger=context userId=0 orgId=0 uname= t=2023-01-24T14:52:51.287624215+07:00 level=error msg="Request Completed" method=GET path=/login/google status=500 remote_addr=1.20.61.241 time_ms=262904 duration=4m22.904587187s size=1365 referer=https://accounts.google.co.th/ handler=/login/:name_badge: 
  • What did you expect to happen?

I want to use OAuth 2 login to Grafana.

  • Can you copy/paste the configuration(s) that you are having problems with?
[auth.google]
enabled = true
allow_sign_up = true
client_id = 
client_secret = 
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
auth_url = https://accounts.google.com/o/oauth2/auth
token_url = https://accounts.google.com/o/oauth2/token
api_url = https://www.googleapis.com/oauth2/v1/userinfo
allowed_domains = gmail.com
hosted_domain = true

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
  1. Request URL:
[type or paste code here](https://XXX.co.th:3443/login/google?state=XXXXX=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+openid&authuser=0&prompt=consent)
  1. Request Method:

GET

  1. Status Code:

500 Internal Server Error

  1. Remote Address:

123.189.210.11:34430

  1. Referrer Policy:

strict-origin-when-cross-origin

  • Did you follow any online instructions? If so, what is the URL?
    Yes , i trie to do it ,But it not work.

I think you need your ‘allowed_domains’ to be your email domain…

i.e. If your email address was joe.blogs@emaildomain.com you need to set ‘allowed_domains’ to be ‘allowed_domains = emaildomain.com

I hope that makes sense.