Python flask saml throwing saml2.sigver.SigverError Error Message
Asked Answered
C

2

11

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

Crosshead answered 28/9, 2018 at 10:53 Comment(6)
Are you sure the required executables are in your PATH?Coverdale
I just started reading through this aleksey.com/xmlsec/download.html but not sure if i'm heading in the right direction. Also, I'm not yet sure where the executables should be.Crosshead
Anywhere in your PATH, in windows you can check if they are by typing where xmlsec in your command promptCoverdale
It does not seem to find xmlsec. I'm now trying to figure out where to get these executables from and how to configure them in my environment.Crosshead
Executables found here zlatkovic.com/pub/libxmlCrosshead
I downloaded the xmlsec1 folder and added the bin folder directory in Environment Variable Path. saml/sso route is working now.Crosshead
S
6

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.

Swung answered 5/10, 2018 at 15:22 Comment(0)
D
1

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
Dichotomous answered 12/9, 2020 at 13:1 Comment(1)
Happy to hear @AjayKumar.Dichotomous

© 2022 - 2024 — McMap. All rights reserved.