Hello. I am using our RPA tool in order to automate a process for an application that uses Okta authentication. When trying from chrome developer console, something like the following:
document.getElementById(“okta-signin-username”).value = “myuser@nice.com”;
document.getElementById(“okta-signin-password”).value = “myPassword”;
values are assigned on the page, but a message showing “Please enter a password” appears.
then Submit button does not work.
The only working method I’ve discovered is using sendkeys in each input field to satisfy the validation prior to the “click()” function. Unfortunately this is not as consistent as I would like and can easily be interrupted by a user.
I’ve also tried using: document.getElementById(“form1”).submit(); instead of clicking “Sign In”, however it just redirects me to an OKTA 404 Page instead of successfully authenticating.
@mraible Thank you for the prompt response. Our solution is end-user facing and we found if we use sendKeys for the full username and password it could easily be captured by launching Notepad and manually grabbing focus before those lines execute. I doubt anyone would replicate it in production, but we decided to scrap that due to the added security risk.
@emoreno Would you mind sharing some of your code used to accomplish this? If I’m understanding correctly, triggering or emulating a keypress event seems more direct then using sendKeys which can be interrupted by a user. Our current solution requires updating the input values normally ($el.value="") and then using sendKeys to send a single character and then a {BACKSPACE} for each field. This technically works, but is definitely not consistent if a user is multitasking and focusing other windows.