Azure OAuth Cannot get Auto_login to work

  • What Grafana version and what operating system are you using?

  • Grafana enterprise 11.5.2 on Windows Server 2016 data center

  • What are you trying to achieve?

  • We are setting up Azure OAuth authentication (which is working) but we can’t seem to get the auto_login settings working correctly. When users hit Grafana we expect it to ask for authentication immediately but at the moment we get the login screen and we have to click ‘sign in with Azure AD’

  • How are you trying to achieve it?
    Set auto_login in the custom.ini file and turned off all other auto_login parameters from other forms of authentication. Azure OAuth is the only auth method in use.

  • What happened?

  • Login screen keeps coming up

  • What did you expect to happen?
    Instead of login screen, expect the microsoft auth page to come straight up as if you click the ‘sign in with Azure AD’ button

  • Can you copy/paste the configuration(s) that you are having problems with?
    #################################### Azure AD OAuth #######################
    [auth.azuread]

name = Azure AD
enabled = true
allow_sign_up = true
auto_login = true
client_authentication = client_secret_post
client_id =
client_secret =
scopes = openid email profile
auth_url =
token_url =
allowed_domains =
allowed_groups =
allowed_organizations =
role_attribute_strict = false
allow_assign_grafana_admin = false
skip_org_role_sync = false
use_pkce = true

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • No

  • Did you follow any online instructions? If so, what is the URL?

  • Yes - ensured only one instance of auto_login is set in the custom.ini

Any help would be greatly appreciated!

Disable other login providers (enabled = false not auto_login = false) and built-in login as well:

[auth]

# Disable usage of Grafana's built-in login solution.
disable_login = false

I’ve only got Azure OAuth provider enabled (enabled=true) all others are false

I’ve only got Auto_login = true set for Azure OAuth

The disable_login parameter changed the login screen to this but really Im trying to get rid of it all together

Thanks

Did you restart Grafana? What’s the Grafana URL in the browser?

Yes, restarted many times.

The local address is http://localhost:3000/login and it still goes to this page where they need to click ‘Sign on with Azure AD’. We also have an external URL as well…

Any error in the browser console? http/localhost may be causing errors. It’s better to test it with full domain and https. Try enable auto login on global level (yes, that’s deprecated now)

Looks like the global level parameter did the trick.

There was a console error but I don’t think that was applicable.

Thanks for your help
Brett