I removed the “-PassThru” parameter on New-UDLoginPage, thinking this would require me to have to provide my credentials. However removing this parameter made no change.
Hello @guy thanks for posting your question. I ended up using two functions one to test the credential, and another to verify if the user was in a specific security group. This may not be the best way but it works without issues to Active Directory:-
Hello @psDevUK thanks for the reply. I tested using your $LoginPage variable, and the $FormLogin variable but I am still not seeing any change. When I visit the site there is no login page.
So I can have a better understanding of where to troubleshoot, if I remove the -PassThru parameter on New-UDLoginPage, I should then be presented with a page where I have to enter my credentials. Is this understanding correct?
@psDevUK Thanks for the efforts. I understand what you are saying about having to call the $LoginPage via the “-LoginPage” parameter, and also the need to have the $FormLogin available. I was unable to get your example to work.
Windows authentication is really just single-sign on and won’t prompt you for a username\password unless the machine you are on is not domain joined. In that case, you’ll be prompted by the web browser and not a UD login page.
What @psDevUK has in his dashboard is actually forms-based authentication. In that example, he’s using an Endpoint to validate that the user is logging.
As you can see, New-UDAuthenticationMethod is using Endpoint rather than the -Windows switch parameter. It’s a bit more manual on the UD side but allows you to validate against whatever system you need but in this case, it’s just Active Directory.
@psDevUK After I gained a better understanding of how authentication works in UD, I was able to get your FormLogin script working in my test build. It worked perfectly, and was exactly what I was looking for. Thank you so much for sharing your work! I don’t know if I would of have been able to get this working how I wanted without your help.
@guy no worries, that’s what this community is all about, helping one another and sharing ideas. Like that weird saying goes “there’s always more than one way to skin a cat” if they have that weird saying where you are from. But anyways the main thing is you got it working, and now you have a better understanding. Hopefully the next time someone posts how do I get login pages working you will be the resident to answer the question
I’m currently using the script that @adam provided above and everything is working great but I was wondering if it would be possible to pass the username and password to a variable so I can use it later on in my dashboard. My end goal is to be able to pass the username and password to a servicenow API so it’ll automatically open a ticket for that user(using their username and password) after they submit a form.
Sweet…I did think more about this question after…and was thinking I am sure there is some key-logging modules out there, and I am sure you could hack yourself together a password gathering tool on login, but I’m no powershell master but I know you could encrypt that password and pass that as credentials, as I do this for my scheduled tasks…but I also understand you can decrypt the files as well, so don’t think this would work too well depending on how secure your encrypted passwords have to be…I use the $User variable to log what time and date that user visits so management can check that people are using it, and I create a $USER folder in the IIS folder which I can then use to plonk any output from the INPUT fields, to check the data before inputting the data into the database.