Redirect URL after logging in with anonymous auth enabled

I have enabled both anonymous auth and basic auth. I also have a multi-tenant setup with different customers using different organizations but allowing anonymous users to view a showcase dashboard/org.

Anonymous auth is set up as follows:

auth.anonymous
enabled true
org_name Main Org.
org_role Viewer

This means that when a user visits the main page the Main Org. dashboards will be visible. After signing in, the redirect querystring parameter is set to the Main Org. dashboard. But as our customers are not members of Main Org. this will result in a 404 (not found) page showing after logging in and being redirected to the Main Org. dashboard.

The desired behaviour is to always go to the user’s organization’s home dashboard after logging in and not respect the redirect URL. Is there a way to configure Grafana in such a way, or a workaround?

2 Likes

I have the same problem. Did you find any solution?

1 Like

A workaround is making Grafana to redirect to default Org. after login by setting redirect_to cookie on web server. Here’s an example for Apache:

RewriteEngine On
RewriteRule ^/login$ - [CO=redirect_to:/d/ABCDEFGH/overview?orgId=1:;:0:/:true:true]

ABCDEFGH is Home Dashbord Id of default Org.
1 is default Org. Id