SAML2 issues with Python 3.9
If using Python 3.9, get a weird error "module 'base64' has no attribute 'decodestring'" if DEBUG is set to true. Otherwise, nothing.
You have to force install a newer version of pysaml2:
pip install "pysaml2==6.5.2"
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
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.
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.
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.
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.
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