Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python flask saml throwing saml2.sigver.SigverError Error Message

Has anyone succesfully implemented flask-saml using Windows as dev environment, Python 3.6 and Flask 1.0.2?

I was given the link to the SAML METADATA XML file by our organisation and had it configured on my flask app.

app.config.update({
    'SECRET_KEY': 'changethiskeylaterthisisoursecretkey',
    'SAML_METADATA_URL': 'https://<url>/FederationMetadata.xml',
})

flask_saml.FlaskSAML(app)

According to the documentation this extension will setup the following routes:

  • /saml/logout/: Log out from the application. This is where users go if they click on a “Logout” button.

  • /saml/sso/: Log in through SAML.

  • /saml/acs/: After /saml/sso/ has sent you to your IdP it sends you back to this path. Also your IdP might provide direct login without needing the /saml/sso/ route.

When I go to one of the routes http://localhost:5000/saml/sso/ I get the error below

saml2.sigver.SigverError saml2.sigver.SigverError: Cannot find ['xmlsec.exe', 'xmlsec1.exe']

I then went to this site https://github.com/mehcode/python-xmlsec/releases/tag/1.3.5 to get xmlsec and install it. However, I'm still getting the same issue.

Here is a screenshot of how I installed xmlsec

where does not seem to find the xmlsec.exe

enter image description here

like image 765
cloudviz Avatar asked Sep 28 '18 10:09

cloudviz


2 Answers

xmlsec won't work properly in windows, better use Linux environment

Type the below command before giving pip install xmlsec

sudo apt-get install xmlsec1
like image 73
Sathia Avatar answered Oct 13 '22 00:10

Sathia


documentationis asking to have xmlsec1 pre-installed. What you installed is a python binding to xmlsec1.

Get a windows build of xmlsec1 from here or build it from source And make it available in the PATH.

like image 44
Arun Karunagath Avatar answered Oct 13 '22 01:10

Arun Karunagath