Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
[#1] Support 'local' authententication (used in sandbox)
Browse files Browse the repository at this point in the history
  • Loading branch information
danmichaelo committed Jun 2, 2016
1 parent bc3c17c commit b71fc6c
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions slipsomat.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,24 @@ def connect(self):
domain = self.config.get('login', 'domain')
self.instance = self.config.get('login', 'instance')
auth_type = self.config.get('login', 'auth_type')
institution = self.config.get('login', 'institution')
username = self.config.get('login', 'username')
password = self.config.get('login', 'password')
self.driver = self.get_driver()

print('Logging in to {} as {}... '.format(domain, username))
self.get('/mng/login?auth={}'.format(auth_type))
print('Opening instance {}:{}'.format(self.instance, institution))

try:
element = self.driver.find_element_by_id("org")
self.get('/mng/login?institute={}&auth={}'.format(institution, auth_type))

select = Select(element)
select.select_by_value(domain)
element.submit()
try:
if auth_type == 'SAML':
print('Logging in as {}@{}'.format(username, domain))
element = self.driver.find_element_by_id("org")
select = Select(element)
select.select_by_value(domain)
element.submit()
else:
print('Logging in as {}'.format(username))

element = self.driver.find_element_by_id('username')
element.send_keys(username)
Expand Down

0 comments on commit b71fc6c

Please sign in to comment.