Page 1 of 1
Browser Autentication
Posted: 15 Apr 2021, 06:54
by franceschinl
Hello Word.
I'm try to search but i don't find a ticket about this improvement
I would like to implement Mantis to recognize the user who is connected to the PC at that time without having to ask a username and password again.
is it possible?
in case of mantis don't recognize the user, mantis ask me to login with username and password.
Is Possible?
Thanks
Re: Browser Autentication
Posted: 20 Apr 2021, 14:44
by cas
Yes you can, use the ADlogin plugin.

Re: Browser Autentication
Posted: 23 Apr 2021, 09:18
by franceschinl
cas wrote: 20 Apr 2021, 14:44
Yes you can, use the ADlogin plugin.
My server isn't in Domain. is possible have a simple auth (ex: i've read username from system and enter in Mantis directly)
Thanks
Re: Browser Autentication
Posted: 23 Apr 2021, 11:55
by cas
you can adjust the ADlogin plugin to read the user logged on to the pc.
Simply retrieve the info from a shell command.
If you run the cmd prompt, you can see who is logged on with the following command:
echo %username%
if you pipe this into a file like
echo %username% > userinfo.txt
You can simply read the content of the file.
Be aware that this is not a very safe option

Re: Browser Autentication
Posted: 23 Apr 2021, 12:21
by franceschinl
cas wrote: 23 Apr 2021, 11:55
you can adjust the ADlogin plugin to read the user logged on to the pc.
Simply retrieve the info from a shell command.
If you run the cmd prompt, you can see who is logged on with the following command:
echo %username%
if you pipe this into a file like
echo %username% > userinfo.txt
You can simply read the content of the file.
Be aware that this is not a very safe option
this is my code
function init() {
plugin_event_hook( 'EVENT_CORE_READY', 'login_ad' );
}
function login_ad() {
if ( isset($_SERVER['AUTH_USER'])) {
$temp = explode('\\', $_SERVER['AUTH_USER']);
if ($temp[1] == "") {
$name = $temp[0];
} else {
$name = $temp[1];
}
$ok=auth_attempt_script_login( $name );
}
}
}
please do you help me to modify (if user are exist: login; if user aren't exist show me login page)
Thanks
Re: Browser Autentication
Posted: 23 Apr 2021, 13:07
by cas
1. when one logs on the pc, a file need to be created holding their username.
2. In the function Login_ad, you read the file
3. place the value in $name
4 all this 92 & 3) just before
$ok=auth_attempt_script_login( $name );
Re: Browser Autentication
Posted: 23 Apr 2021, 13:34
by franceschinl
cas wrote: 23 Apr 2021, 13:07
1. when one logs on the pc, a file need to be created holding their username.
2. In the function Login_ad, you read the file
3. place the value in $name
4 all this 92 & 3) just before
$ok=auth_attempt_script_login( $name );
No. I found another solution...... (IDK what is)
Re: Browser Autentication
Posted: 23 Apr 2021, 16:23
by cas
so what did you do?
Re: Browser Autentication
Posted: 26 Apr 2021, 10:51
by franceschinl
cas wrote: 23 Apr 2021, 16:23so what did you do?
i've install AD and LDAP but not work.
in ldap configuration i need insert admin user and passowrd (not good)
but the browser doesn't recognize my username from browser and i insert manually user and password (same of LDAP)
Solution?
Re: Browser Autentication
Posted: 27 Apr 2021, 09:42
by franceschinl
you have try to use BasicAuth?