SOLVED: Auth.google Login Failed Error: Required email domain not fulfilled

Hi guys,

Battling with ouath.google on following:

Grafana listens on port 3333 (which docker maps to port 3000 inside the grafana container).

Grafana v6.3.0-beta2
root_url = https://humanalyse.com:3333

On console.developers.google.com/, Authorized redirect URIs = http://humanalyse.com:3333/login/google

In grafana.ini:
allowed_domains = humanalyse.com

The “Sign in with Google” button takes me to the account selection list and when I select, then browser popup displays:

Login Failed Error: Required email domain not fulfilled
Grafana logs:

{"log":"t=2019-07-30T13:33:54+0000 lvl=info msg=\"state check\" logger=oauth queryState=3c7ca37c04fdbc67e93ea3c7a1f8a6128566903aeeeb2dde25e48f34d02d6824 cookieState=3c7ca37c04fdbc67e93ea3c7a1f8a6128566903aeeeb2dde25e48f34d02d6824\n","stream":"stdout","time":"2019-07-30T13:33:54.576807785Z"}
{"log":"t=2019-07-30T13:33:54+0000 lvl=eror msg=\"Required email domain not fulfilled\" logger=context userId=0 orgId=0 uname=\n","stream":"stdout","time":"2019-07-30T13:33:54.704840012Z"}

If I leave out the `https://` in the following lines (as per a previous posting):

auth_url = https://accounts.google.com/o/oauth2/auth
token_url = https://accounts.google.com/o/oauth2/token

Then I see a long string in the URL window of the browser, viz:
http://humanalyse.com:3333/login/accounts.google.com/o/oauth2/auth?access_type=online&client_id=498474136737-phihkmcjmp7oia2jm3cbahm1nfip9s0n.apps.googleusercontent.com&redirect_uri=http:%2F%2Fhumanalyse.com:3333%2Flogin%2Fgoogle&response_type=code&scope=https:%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile%20https:%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&state=D-33At6lJ4jRa4jW_OBf-DFPzn51Y_WnTMQRJZilxWk%3D
and a **404** Error

FWIW, I have the following setup (which works so far to deliver https whatever the user punches into the browser):

`% curl https://humanalyse.com`
<a href="/login">Found</a>

`% curl humanalyse.com`
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://humanalyse.com/">here</a>.</p>
<hr>
<address>Apache/2.4.29 (Ubuntu) Server at humanalyse.com Port 80</address>
</body></html>



`% curl http://humanalyse.com:3333`
<a href="/login">Found</a>.

` % curl humanalyse.com:3333`
<a href="/login">Found</a>

`% curl https://humanalyse.com:3333`
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number


Any assistance is very much appreciated!

SOLVED:
It needed in grafana.ini:
allowed_domains = gmail.com

1 Like