How to do OKTA authentication through API using selenium python?

1k Views Asked by At

I want to login page by okta authentication. When I give user id and password and presses push button it sends request on mobile OKTA app then I have to approve it. I have tried multiple things but not able to bypass this.

My requirement is simple, I want to login page without touching anything and authentication should also happen automatically. I am writing script in python using selenium.

Is there any way to do the same in python?

driver.get("url")

driver.implicitly_wait(30)

search = driver.find_element(By.XPATH, 'xpath').click()

driver.implicitly_wait(30)

username = driver.find_element(By.ID, 'username1234').send_keys(user_id)

password = driver.find_element(By.ID, 'password1234').send_keys(password)

driver.implicitly_wait(10)

driver.find_element(By.ID, 'id').click()

driver.implicitly_wait(10)

iframe = driver.find_element(By.ID, "okta_id")

driver.switch_to.frame(iframe)

driver.find_element(By.XPATH, 'xpath').click()

print("Wait started")

driver.implicitly_wait(90)

After this it should happen automatically. recently i have to approve in my mobile.

0

There are 0 best solutions below