Hello everyone,
I'm new with NSIS and I've searched the FAQ's but couldn't find any info regarding this matter:
is it possible to make user authentication in an installer? I want to make authentication based on username/password in a remote HTTP server. Is it possible?
Thanks everyone
Authentication in Installer possible?
13 posts
Sure. Use the PassDialog plugin or create a custom NSIS installer page with the InstallOptions plugin.
-Stu
-Stu
Thanks for the quick reply
OK, but how can I add that plugin? I am using EclipseNSIS, and I have just realized that I can make my own custom installer dialogs (INI files, right?).
But how can I add actions to the buttons? (example: Next Button moves to next page, a Validate Button will authenticate the provided username/password in a remote server, etc)
Thank you once more
OK, but how can I add that plugin? I am using EclipseNSIS, and I have just realized that I can make my own custom installer dialogs (INI files, right?).
But how can I add actions to the buttons? (example: Next Button moves to next page, a Validate Button will authenticate the provided username/password in a remote server, etc)
Thank you once more
I wouldn't recommend using a InstallOptions INI files because it means your username and password is stored in the INI file until the installer is closed.
With PassDialog, just put the dll in the Plugins folder, then read the readme.
-Stu
With PassDialog, just put the dll in the Plugins folder, then read the readme.
-Stu
Thanks again, Afrow!
I managed to make it work, but the usernames and passwords are just placed directly in the code (btw, nsis scripts have their own language, right? Do you know some page where I can learn the basics of Nsis scripting?), but how can I make the validation in a remote HTTP server (something like http://foo.com/authenticate?username=xxx&passwd=xxx, which gives me the result of validation: valid or invalid user)
Thanks
I managed to make it work, but the usernames and passwords are just placed directly in the code (btw, nsis scripts have their own language, right? Do you know some page where I can learn the basics of Nsis scripting?), but how can I make the validation in a remote HTTP server (something like http://foo.com/authenticate?username=xxx&passwd=xxx, which gives me the result of validation: valid or invalid user)
Thanks
Hey, in the meanwhile, I am trying this:
I've created a DLL which receives 2 Strings, username and password, and returns a String indicating if the user is valid or not;
I've red this: http://nsis.sourceforge.net/Calling_...tem.dll_plugin but i don't understand where the dll must be placed and how exactly to call the function with the right parameters and to receive the result
Can anybody help?
I've created a DLL which receives 2 Strings, username and password, and returns a String indicating if the user is valid or not;
I've red this: http://nsis.sourceforge.net/Calling_...tem.dll_plugin but i don't understand where the dll must be placed and how exactly to call the function with the right parameters and to receive the result
Can anybody help?
Use the InetLoad plugin to send a POST request.
Your DLL must be extracted first, preferably to $PLUGINSDIR and then you need to register it with RegDLL and then unregister it afterwards with UnRegDLL.
Why would you want to check the username and password in a DLL anyway? What happens when you need to add more usernames and passwords to existing installers? You'd have to rebuild the DLL.
If you're only going to have one username and one password, you might as well just validate them with StrCmp (or use LStrCmp on the Wiki for case sensitive comparison).
-Stu
Your DLL must be extracted first, preferably to $PLUGINSDIR and then you need to register it with RegDLL and then unregister it afterwards with UnRegDLL.
Why would you want to check the username and password in a DLL anyway? What happens when you need to add more usernames and passwords to existing installers? You'd have to rebuild the DLL.
If you're only going to have one username and one password, you might as well just validate them with StrCmp (or use LStrCmp on the Wiki for case sensitive comparison).
-Stu
No, that's not the idea, the usernames and passwords are not in the DLL file.
The DLL has a function which receives 2 strings (username and password) and returns a string indicating that the user is or is not valid.
All I need to do right now is to call the DLL with the right parameters and to get the answer. How can I do that?
What is the syntax of a DLL call with two string inputs and a return string output?
The DLL has a function which receives 2 strings (username and password) and returns a string indicating that the user is or is not valid.
All I need to do right now is to call the DLL with the right parameters and to get the answer. How can I do that?
What is the syntax of a DLL call with two string inputs and a return string output?
There's dozens of System examples in the Examples\System folder.
Use t for text (strings).
-Stu
Use t for text (strings).
-Stu
Hi again
I've seen the System script you mentioned, but I couldn't find any example in which the function actually returned a value.
All I need to do is to get the result of
System::Call 'Authenticator::ValidateClass.validate($R0, $R1) $R3'
So that I can print it, like:
MessageBox MB_OK "Result: $R3"
But why doesn't appear anything in $R3?
What am I doing wrong?
I've seen the System script you mentioned, but I couldn't find any example in which the function actually returned a value.
All I need to do is to get the result of
System::Call 'Authenticator::ValidateClass.validate($R0, $R1) $R3'
So that I can print it, like:
MessageBox MB_OK "Result: $R3"
But why doesn't appear anything in $R3?
What am I doing wrong?
Just guessing:
System::Call 'Authenticator::ValidateClass.validate(t R0, t R1) t.R3'
👍
My post was about syntax 😁
🙄 I was not aware about the .NET thing...
My post was about syntax 😁
🙄 I was not aware about the .NET thing...