-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Netbox 3.0 or 3.0.2 #45
Comments
Hello,
I'm available for testing and troubleshooting. |
"If using NetBox's built-in remote authentication backend, update REMOTE_AUTH_BACKEND to 'netbox.authentication.RemoteUserBackend', as the authentication class has moved." https://netbox.readthedocs.io/en/stable/release-notes/version-2.9/#configuration-changes |
I'm using the plugin to handle SAML authentication and not the build-in auth backend, this is a snippet of the extra.py file working with v2.11
your suggestion is to change REMOTE_AUTH_BACKEND from wouldn't it just revert to the built-in auth and lose SAML functionalities? |
I concur with this, how does this modification effect that this plugin doesn't build when using Netbox 3.0.2 ? |
I am also getting the I think the root issue is the File "/opt/netbox/venv/lib/python3.9/site-packages/django3_auth_saml2/urls.py", line 3, in <module>
from . import views File "/opt/netbox/venv/lib/python3.9/site-packages/saml2/saml.py", line 90, in <module>
_b64_decode_fn = getattr(base64, 'decodebytes', base64.decodestring) Looks like |
This solution will depend on your deployment, but I was able to resolve the issue by adding It will give you the following error when you build the image:
This can be ignored as far as I can tell. Once the new version of |
Thanks, this worked for me. Got the error you mentioned on build but afterwards it seems to work fine. I've tested this on the latest version of Nextbox (3.0.7). |
@jacobhrussell - thank you for digging into this issue and finding the root cause. There is another package that needs to be installed, which is here: https://github.com/jeremyschulman/django3-auth-saml2/blob/master/requirements.txt and that does have the pysaml2 library pinned to 6.5.0. |
@jeremyschulman my pleasure and thanks for the awesome plugin! |
Hey all I've recently deployed Netbox 3.0.10 and I'm currently getting this issue. I upgrade pysaml2 to 6.5.0 however the problem is still occurring. Any ideas on anything else I can check? This is a pretty fresh install (not using docker) Thanks |
Here's my Dockerfile (DockerHub). I needed to explicitly pin pysaml2 to 6.5.2 to get it to work. |
for those of us not using Docker and who must have repeatable Ansible scripts, these workarounds are not a proper method to solve this. We need a proper solution (django3-auth-saml2 updated in pypi to support pysaml2 >= 6.5.2 (latest is 7.1.0). I'm also not able to pull from github due to airgapped servers and have to rely on replicated pypi repo, so if it isn't in pypi, I can't use it. |
@celldara - I can fix this. I think the right thing to do is to unpin the version of pysaml2 in the django3-auth-saml2 repo. If I did that then I believe you would most likely need to install pysaml2 first with the version you need, and then install the django3 repo. Would that approach work for you? |
@jeremyschulman as long as it makes it into the pypi repository. I can only use it if it is pushed to pypi. You already have a version that supports pysaml2==6.5.0 but it isn't pushed to pypi either. Maybe set a minimum version of 6.5.2 (which seems to work with Python 3.9) and let it match at least that |
ok, I'll push it to pypi shortly. sorry for that.
…On Thu, Dec 2, 2021 at 1:00 PM celldara ***@***.***> wrote:
@jeremyschulman <https://github.com/jeremyschulman> as long as it makes
it into the pypi repository. I can only use it if it is pushed to pypi. You
already have a version that supports pysaml2==6.5.0 but it isn't pushed to
pypi either.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#45 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAT4WVDMAHFDUHM46QXAGATUO6X23ANCNFSM5EH2DERQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Thank you. I was dreading doing the SAML2 auth to NetBox when I found your solution. Much nicer than doing it in Apache using mod_auth_mellon. |
@celldara - ok, I just pushed a version of django repo that sets saml2 to >= 6.5.0. The new release version is 0.2.1. Please give that a try and let me know if that works for you; or if not we can work through the issues. |
I'll have to wait for the pypi repo to replicate here. I still have lots of work to finish up on what is needed to migrate our old data to the new servers, so it may be a couple days before I test. |
@jeremyschulman The new version pushed to pypi worked great. It allowed install of pysaml2 7.1.0 (it just installed the latest version by default without having to specify a version). SAML2 Auth with Azure SSO works great with Python 3.9 now. Thanks |
@celldara - excellent. I would like to close this issue @RyanMesser. Would that be AOK with you? |
Hi,
This plugin works fine in Netbox 2.9.11 but when updating to 3.0 or 3.0.2 I get the below error and the container doesn't start. I tried adding this to the Dockerfile but has had no effect
RUN sed -i 's/base64.decodestring/base64.decodebytes/g' /opt/netbox/venv/lib/python3.9/site-packages/saml2/saml.py
The error I get in the logs is the below
File "/opt/netbox/venv/lib/python3.9/site-packages/saml2/saml.py", line 91, in ,
_b64_encode_fn = getattr(base64, 'encodebytes', base64.encodestring)
Any ideas on what I could do to fix?
The text was updated successfully, but these errors were encountered: