Page 1 of 1
Nagvis logout
Posted: Wed May 21, 2014 1:03 pm
by BanditBBS
Ok, so I am finally starting to use nagvis here and believe it or not, I only have one question(I've used it in a past life).
How on earth do you logout of NagVis? In IE if I close the window and go back in, it requests my nagvis ID/Pass again, but in Chrome it only did the first time and no matter what I try it never asks be who I am again and I can't get logged out as my nagvis admin ID.
Re: Nagvis logout
Posted: Wed May 21, 2014 1:46 pm
by lmiltchev
Does clearing the browser's cookies help?
Re: Nagvis logout
Posted: Wed May 21, 2014 1:49 pm
by BanditBBS
lmiltchev wrote:Does clearing the browser's cookies help?
Probably, but I don't want to have to do that every time I login to nagvis on a different PC. That would probably upset some users, lol.
Re: Nagvis logout
Posted: Wed May 21, 2014 2:08 pm
by snapon_admin
Agreed, we've used NagVis for awhile now and the lack of a logout option is....irritating. No one's really complained about it until recently so I've never bothered with a feature request or anything, but now that it's come up it is somewhat annoying to not have a way to logout.
Re: Nagvis logout
Posted: Wed May 21, 2014 3:45 pm
by BanditBBS
FYI - I deleted cookies and I am still being auto logged in as my admin user.
Re: Nagvis logout
Posted: Thu May 22, 2014 9:30 am
by abrist
You need to clear the browser cache, as basic auth tokens are stored there.
Re: Nagvis logout
Posted: Thu May 22, 2014 9:40 am
by BanditBBS
abrist wrote:You need to clear the browser cache, as basic auth tokens are stored there.
I guess I have to live with this and just don't login to nagvis as me on other people's computers. Go ahead and lock this up.
Re: Nagvis logout
Posted: Thu Sep 29, 2016 11:19 am
by rkennedy
Posting this solution here for anyone that is searching around as I solved this in a ticket today.
First, open up /usr/local/nagvis/share/userfiles/templates/default.header.html
Look for -
<li><a href="#">{$langLoggedIn}: {$currentUser}</a></li>
Below it, add -
<li><a href="../../logout">Logout</a></li>
Now, open up /etc/httpd/conf.d/nagvis.conf and navigate tot the end of the file, you should see -
</IfModule>
</Directory>
You'll need to add two things here. First, above both of those lines add -
# Added for Nagvis logout button
RewriteCond %{HTTP_COOKIE} ^.*logout=1.*$
RewriteRule ^/nagvis/logout$ / [R,L,co=logout:0:%{HTTP_HOST}:0:/logout]
RewriteRule ^/nagvis/logout$ - [R,L,co=logout:1:%{HTTP_HOST}:0:/logout]
Then, below both of the lines add -
<Location /nagvis/logout>
Require user nonexistinguser
</Location>
The bottom of the file should now look like this -
# Added for Nagvis logout button
RewriteCond %{HTTP_COOKIE} ^.*logout=1.*$
RewriteRule ^/nagvis/logout$ / [R,L,co=logout:0:%{HTTP_HOST}:0:/logout]
RewriteRule ^/nagvis/logout$ - [R,L,co=logout:1:%{HTTP_HOST}:0:/logout]
</IfModule>
</Directory>
<Location /nagvis/logout>
Require user nonexistinguser
</Location>