Automatic login

This support forum board is for support questions relating to Nagios Network Analyzer, our network traffic and bandwidth analysis solution.
Locked
evisus
Posts: 82
Joined: Tue Apr 26, 2016 1:19 pm

Automatic login

Post by evisus »

Cheers!

I would like your help in the following case:

We need to perform automatic login in Nagios NA using a method similar to Nagios XI in "Auth Tokens".

Our intention is to send the user and the credential by means of a post or "Auth Tokens" so that the user does not have to enter his credential in Nagios NA.

I have seen the documentation but something similar is not seen. Can you give me any hints on how to achieve this?

Thank you
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Automatic login

Post by cdienger »

NNA doesn't have the same option, but you can 'automatically' login with a couple steps:

First open the nagiosna/login page and parse it to find the csrf_tna value which will be in a form:

Code: Select all

<form action="/nagiosna/login" method="post" accept-charset="utf-8" class="form-horizontal login"><div style="display:none">
<input type="hidden" name="csrf_tna" value="0fadf4df1fde7d4e102a0c5302b3306b" />
put this in the body along with the username and password of a POST request to nagiosna/login:

Code: Select all

POST /nagiosna/login HTTP/1.1
Host: nna_ip
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 79
Origin: http://nna_ip
Connection: keep-alive
Referer: http://nna_ip/nagiosna/login
Upgrade-Insecure-Requests: 1
DNT: 1

csrf_tna=0fadf4df1fde7d4e102a0c5302b3306b&username=nagiosadmin&password=welcome
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked