Auth-proxy can't safe dashboards

Hello friends,

I’m using Auth Proxy Authentication in Grafana.
I use Node.js on port:4000 and Grafana on port:3000.

Everything seems to work, but saving dashboards doesn’t work what am I doing wrong? have I missed any permissions?

my settings in grafana.ini:
enabled = true
header_name = X-WEBAUTH-USER
header_property = username
auto_sign_up = true
ldap_sync_ttl = 60
whitelist =

#The http port to use
http_port = 3000
#The public facing domain name used to access grafana from a browser
domain = localhost
#The full public facing url
root_url = %(protocol)s://%(domain)s:%(http_port)s/
#this is what I’ve been trying to do, too.:
#root_url = https://localhost:4000

i don’t know whether the log entry in grafana.log helps or has nothing to do with it… but:
t=2018-12-17T01:10:35+0100 lvl=info msg=“Request Completed” logger=context userId=5 orgId=1 uname=try method=POST path=/api/dashboards/db/ status=400 remote_addr= time_ms=120007 size=153 referer=“http://localhost:4000/dashboard/new?orgId=1

simple nodejscode:
#requires: ‘express’, ‘body-parser’, ‘http-proxy’

var apiProxy = httpProxy.createProxyServer();
var serverOne = ‘http://localhost:3000’;
// creating the serverapplication
const app = express();

const auth=“try”
// encodes json

apiProxy.on(‘proxyReq’, function(proxyReq, req, res, options) {
proxyReq.setHeader(‘X-WEBAUTH-USER’, auth);
proxyReq.setHeader(‘Authorization’, “”);
app.use((req, res, next) => {
apiProxy.web(req, res, {target: serverOne});

1 Like

What is your user’s privilege level in Grafana?
The default is Viewer.
If you want to leave auto_assign_org_role = Viewer, then just use your Server Admin user to raise your regular user’s privileges within Grafana’s user management UI. The auto_assign_org_role is used for the first login only.

After several days I was able to solve the problem.
The configurations were all right but something didn’t work with the npm package. i exchanged it with the '‘express-http-proxy’
now it works. But thanks anyway @adeverteuil :smiley: .

Worked like charm. Thanks.