Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion roadtx/roadtools/roadtx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,9 @@ def main():
intauth_parser.add_argument('--otpseed',
action='store',
help='TOTP seed to calculate MFA code when prompted')
intauth_parser.add_argument('--headless',
action='store_true',
help='Run Selenium in headless mode')

# Interactive auth using Selenium - creds from keepass
kdbauth_parser = subparsers.add_parser('keepassauth', help='Selenium based authentication with credentials from a KeePass database')
Expand Down Expand Up @@ -1588,7 +1591,7 @@ def main():
redirect_url = args.redirect_url
else:
redirect_url = find_redirurl_for_client(auth.client_id, interactive=False)
selauth = SeleniumAuthentication(auth, deviceauth, redirect_url, proxy=args.proxy, proxy_type=args.proxy_type)
selauth = SeleniumAuthentication(auth, deviceauth, redirect_url, proxy=args.proxy, proxy_type=args.proxy_type, headless=args.headless)
if args.url:
url = args.url
else:
Expand Down
4 changes: 2 additions & 2 deletions roadtx/roadtools/roadtx/selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def wrapped(*args, **kwargs):
return wrapped

class SeleniumAuthentication():
def __init__(self, auth, deviceauth, redirurl, proxy=None, proxy_type="http"):
def __init__(self, auth, deviceauth, redirurl, proxy=None, proxy_type="http", headless=False):
if proxy:
# Strip possible prefixes
proxy = proxy.replace('http://','').replace('https://','').replace('socks://','').replace('socks4://','').replace('socks5://','')
Expand All @@ -51,7 +51,7 @@ def __init__(self, auth, deviceauth, redirurl, proxy=None, proxy_type="http"):
self.deviceauth = deviceauth
self.driver = None
self.redirurl = redirurl
self.headless = False
self.headless = headless

def get_service(self, driverpath):
# Default expects geckodriver to be in path, but if it exists locally we use that
Expand Down