Problem while signing in to SSO
Opened this issue · 1 comments
mblu99 commented
Hello,
When I am using the python script rhapi.py to query the database, I receive this error due to an issue with the SSO:
rhapi.py:74, in CernSSO.read_form(self, r)
72 form = root.find(".//{http://www.w3.org/1999/xhtml}kc-form")
73 print(form)
---> 74 action = form.get('action')
75 print(action)
76 form_data = dict(
77 ((e.get('name'), e.get('value')) for e in form.findall(".//{http://www.w3.org/1999/xhtml}input")))
AttributeError: 'NoneType' object has no attribute 'get'
I have changed the code as follows to get it to work again:
def read_form(self, r):
root = self.html_root(r)
form = root.find(".//form[@id='kc-form-login']")
if type(form) == type(None):
# because there are two different forms with different names
form = root.find(".//form[@name='saml-post-binding']")
action = form.get('action')
else:
action = form.get('action')
form_data = dict(((e.get('name'), e.get('value')) for e in form.findall(".//input")))
return action, form_data
resthub/clients/python/src/main/python/rhapi.py
Lines 67 to 73 in bc6ea39
dimattia commented
Hello,
I just pushed in my fix before seeing this message. Sorry. Anyway my implementation of the fix is pretty similar.