How to configure email_attribute_name for generic oauth

When Grafana try delegate authentication it have an error : msg=“OAuthLogin got user info” logger=oauth userInfo="&{Id: Name: Email: Login: Company: Role:}"

It expect to receive “email” but my oauth provider give “mail”:
{“mail”:“user_email”,“scope”:[“mail”,“scope2”],“grant_type”:“authorization_code”,“realm”:"/AccessManagement",“scope2”:“user_name”,“token_type”:“Bearer”,“expires_in”:86399,“client_id”:“TEST”,“access_token”:“a80dmb97-f3t0-4ab0-b754-96909c9f9494”}"

Those configurations doesn’t work:

  • GF_AUTH_GENERIC_OAUTH_EMAIL_ATTRIBUTE_NAME=“mail”
  • GF_AUTH_GENERIC_OAUTH_EMAIL_ATTRIBUTE_NAME=“mail:primary”

Any idea?

Thx

Are you using 5.3 beta1? That feature is only available in the latest beta

I use “Grafana v5.4.0-pre1”. Same with 5.3.0-beta3

How to use “email_attribute_name” to set e-mail address attribute to “mail”?

Any idea? Or documentations?

Hi,

It is redirect to ‘/login/generic_oauth’ how to fix this issue it in not login and it show the error " localhost redirected you too many time"
Let me know how to fix it?