Auto_assign_org and auto_assign_org_id does not work for the users logging in with google auth

Grafana Version: 5.x
OS: Ubuntu 16

What we need to achieve

We have enabled google auth for the grafana user management, We have two organisation in the grafana

Default Org → org_id =1
Company Org → org_id = 2

We want when the users logging in user google, they should be redirected to Company Org i.e. org_id =2

Changes we made

I have tried setting up auto_assign_org=true and auto_assign_org_id =2 in the users section of grafana.

What happened?

The users are still getting pointed to default org id 1 when logging using google auth

Note: If the users are logging directly on grafana without google auth, they are getting redirected to org_id 2

The users should be redirected to org_id 2.
We believe there should be the similar flags auto_assign_org and auto_assign_org_id somewhere in the config in grafana.ini

Configuration Used

enabled = true
client_id = xxxxxxxxxxxxxxxx
client_secret = xxxxxxxxxxxxxx
scopes =
auth_url =
token_url =
allowed_domains =
allow_sign_up = true
allowed_organizations = xxx
org_name = xxx
;allow_sign_up = true
auto_assign_org = true
auto_assign_org_id = 2
;auto_assign_org_role = Viewer


That is a very old version of grafana.

Can you spin up the latest in anew ubuntu and see if this issue persists

Thanks, Yosiasz for the instant reply. can you help me with which grafana version I have to upgrade to achieve this ??
Because I have tested same on with the grafana version 9.0.2

The issue persists in 9.0.2?

yes, when user login via google auth always login in default org. i.e still.