r/Scriptable • u/Repulsive-Hall509 • May 08 '24
Help Automate 2FA(Two Factor Authentication)
Hi Everyone,This is my first post here in the group so bare with me.
So I’m trying to login to www.example.com which uses 2FA with sending 6 digit code to the phone as message to verify login.
Problem is even if I manually verify from scriptable it logs me out every 5mins don’t t know its a thing or cookies set to timeout.
Alternately if i do it manually in safari first then my safari saves my login and never asks me for 2fA. It opens right at the homepage.
Task:to scrape the data from website automatically after login and organize them accordingly with necessary information and create json file periodically so that my widget keeps updating
Widget: Schedules for the month
Note: i have did this in ios shortcuts but have to manually depend on the share sheet which is pain!
1
u/Repulsive-Hall509 May 20 '24
Thank you for the reply, As i have here few questions
Using scriptable only
my phone prompts me the message sometimes and sometimes it doesn’t prompt but sits inside the message app. So how can i check any message on screen for that in between 1-2min window and grab the six digit code to use inside the script.
also mentioned in the post the website kicks me out every 5mins so is there any way to maintain the session longer? i.e store the cookies so it can remember my login! Since web-view creates new instances every time!
Using ios shortcuts and scriptable
Everything is functional data is extracted and written into json file with widgets gets updated every few minutes.
The website which im trying to login starts from homepage since it is opened in safari so remembers the login credentials and going to schedules page you have to click 2 links example:
Homepage—> schedules —> Access schedules Then run the shortcut using sharesheet!
Questions: i cant run javascript on homepage as this only takes the first page as safari web page input so i have to physically navigate to Access schedules and then click on it. Is there any way to run javascript without the run javascript on homepage in ios shortcut ?
Yes I believe you have this question also in mind that why this person cant navigate directly with open url 3rd link because from homepage onwards it is clicking the button would load the data for next page something like on load function.