Hello Exprts,
After upgrading from CDH 5.15 to CDP 7.1.6 the HUE SAML stopped working. We are seeing an error below when trying to login via SAML:
AttributeError at /saml2/acs/
’NoneType’ object has no attribute 'strip’
Request Method: POST
Request URL: http://xxxx.com:8889/saml2/acs/
Django Version: 1.11.29
Exception Type: AttributeError
Exception Value:
‘NoneType’ object has no attribute ‘strip’
Exception Location: /opt/cloudera/parcels/CDH-7.1.6-1.cdh7.1.6.p0.10506313/lib/hue/build/env/lib/python2.7/site-packages/pysaml2-4.9.0-py2.7.egg/saml2/response.py in for_me, line 212
Python Executable: /opt/cloudera/parcels/CDH-7.1.6-1.cdh7.1.6.p0.10506313/lib/hue/build/env/bin/python2.7
Python Version: 2.7.5
Python Path:
[’/opt/cloudera/parcels/CDH-7.1.6-1.cdh7.1.6.p0.10506313/lib/hue/desktop/libs/libsaml/attribute-maps’,
Below is the python code in line 212 which errors out:
202 def for_me(conditions, myself):
203 """ Am I among the intended audiences """
204
205 if not conditions.audience_restriction: # No audience restriction
206 return True
207
208 for restriction in conditions.audience_restriction:
209 if not restriction.audience:
210 continue
211 for audience in restriction.audience:
212 if audience.text.strip() == myself:
213 return True
214 else:
215 # print("Not for me: %s != %s" % (audience.text.strip(),
216 # myself))
217 pass
218
219 return False