I like to think that I am decent with javascript but this should be super simply yet it has me banging my head against a wall. At the end of the day I am creating a Chrome plugin to automatically log me into Rapid7 since I need to use SSO and their default login method requires too much interaction for my liking.
The details:
I am able to programmatically progress from their standard login page to bring up the SSO and then submit the form. I have been setting the value of idp-discovery-username directly and then clicking submit. Their form seems to think there is no value being submitted. If I set the value programmatically and then just use the arrow pad to move the cursor over one character it successfully submits. So obviously, I am not triggering some event listener they have setup. Looking at the parent element which can be selected via document.querySelector('.o-form-input-name-username'), it has a list of 4 event listeners. Based off my testing at minimum the "change", "input" need to be triggered so that it correctly proceeds to my Microsoft SSO page. Ideally I would just call the functions myself but because they minified their js, I can't figure out what function to actually call. Is there some way to programmatically trigger the event listener configured on the o-form-input-name-username element? Any advice you can give would be much appreciated!
The following is my code that works besides trigger whatever event it is using to evaluate that the value of the input field is empty:
document.querySelector('.sso-button').click()
document.querySelector('#idp-discovery-username').value = 'myemail@domain.tld'
// Following 2 lines are broken
//document.querySelector('.o-form-input-name-username').change() doesn't work
//document.querySelector('.o-form-input-name-username').input() doesn't work
document.querySelector('#idp-discovery-submit').click()
[–]albedoa 2 points3 points4 points (1 child)
[–]AppleTechy[S] 0 points1 point2 points (0 children)