updated code to work with latest pysaml2 (for python3)