netbox-plugin-auth-saml2 icon indicating copy to clipboard operation
netbox-plugin-auth-saml2 copied to clipboard

SAML2 issues with Python 3.9

Open celldara opened this issue 4 years ago • 7 comments

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

celldara avatar Dec 02 '21 15:12 celldara

You have to force install a newer version of pysaml2:

pip install "pysaml2==6.5.2"

devon-mar avatar Dec 02 '21 15:12 devon-mar

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

celldara avatar Dec 02 '21 16:12 celldara

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.

devon-mar avatar Dec 02 '21 16:12 devon-mar

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.

celldara avatar Dec 02 '21 16:12 celldara

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.

devon-mar avatar Dec 02 '21 16:12 devon-mar

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.

celldara avatar Dec 02 '21 16:12 celldara

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

markkuleinio avatar Dec 03 '21 09:12 markkuleinio