jeremyschulman / netbox-plugin-auth-saml2

Netbox plugin for SSO using SAML2
119 stars 21 forks source link

SAML2 issues with Python 3.9 #49

Open celldara opened 2 years ago

celldara commented 2 years ago

If using Python 3.9, get a weird error "module 'base64' has no attribute 'decodestring'" if DEBUG is set to true. Otherwise, nothing.

devon-mar commented 2 years ago

You have to force install a newer version of pysaml2:

pip install "pysaml2==6.5.2"
celldara commented 2 years ago

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. django3-auth-saml2 0.2.0 requires pysaml2==5.0.0, but you have pysaml2 6.5.2 which is incompatible.

And this when running upgrade.sh after installying pysaml2==6.5.2

The conflict is caused by:
    The user requested pysaml2==6.5.2
    django3-auth-saml2 0.2.0 depends on pysaml2==5.0.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
devon-mar commented 2 years ago

I get that error when building my Docker image, but it still works. You'll get that because django3-auth-saml2 has pysaml2 pinned on 5.0.0, or at least the version on pypi does.

celldara commented 2 years ago

The venv build fails, therefore cannot continue.

It appears that django3-auth-saml2 has updated to allow 6.5.0, but hasn't released it to pypi and I can't use anything that isn't in pypi.

Looks like need to change this issue to django3-auth-saml2 instead of here.

devon-mar commented 2 years ago

You could try install django3-auth-saml from git (I haven't tried it myself):

pip install git+https://github.com/jeremyschulman/django3-auth-saml2

Also take a look at #45 if you haven't already.

celldara commented 2 years ago

As I said, I have to install from pypi as a requirement for this project. I cannot install from git. The project doesn't allow connection to outside systems and they replicate pypi repo as well as create RPMs for NetBox, so everything is installed from local repositories only.

markkuleinio commented 2 years ago

FYI now that the new django3-auth-saml2 has been published, see also: https://github.com/jeremyschulman/django3-auth-saml2/issues/12#issuecomment-985310213

Update: ah, mentioned also here: https://github.com/jeremyschulman/netbox-plugin-auth-saml2/issues/46#issuecomment-952560430