New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set auth.oauth_auto_login via environment variable #14435

Closed
sbrandtb opened this Issue Dec 10, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@sbrandtb
Copy link

sbrandtb commented Dec 10, 2018

What Grafana version are you using?

5.4.{0,1}

What OS are you running grafana on?

Official Docker image on Kubernetes

What did you do?

Set environment variable GF_AUTH_OAUTH_AUTO_LOGIN to true.

What was the expected result?

  • Grafana redirects to our oauth provider instead of the login page.
  • Admin settings panel shows true for the variable auth -> oauth_auto_login

What happened instead?

  • Grafana still shows login page
  • Admin settings panel shows false

Further information

We are configuring all other settings with environment variables as well and it works, e.g. for SMTP from address:

~ $ kubectl exec -it grafana-55c76cbf79-lhj6r -- sh -c 'echo $GF_SMTP_FROM_ADDRESS'
admin@forfriday.de
~ $ kubectl exec -it grafana-55c76cbf79-lhj6r -- sh -c 'echo $GF_AUTH_OAUTH_AUTO_LOGIN'
true

Judging from the code in #12029 I don't see a reason why this would not work (because it's using the standard settings constructor) and no reason why the code should switch the setting to false due to side conditions, so I would expect that it shows true under any circumstances.

@torkelo

This comment has been minimized.

Copy link
Member

torkelo commented Dec 11, 2018

Thanks for reporting this, classic mistake on our end, forgot to add this setting to the defaults file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment