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 92065c7 commit b02ece2
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

2 comments on commit b02ece2

@ewinge
Copy link
Member

@ewinge ewinge commented on b02ece2 Jun 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add institution to config.cfg.dist?

@danmichaelo
Copy link
Member Author

@danmichaelo danmichaelo commented on b02ece2 Jun 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely :)

Here: a5abbe5

Please sign in to comment.