jeremyschulman / netbox-plugin-auth-saml2

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

Not logged in after login #76

Closed ProbstenHias closed 7 months ago

ProbstenHias commented 7 months ago

So after setting up the plugin I successfully got it working and a new User is created when loggin in via SAML.

The problem I am facing now is that the user is just not logged in.

I have deployed netbox via a helm chart and my values.yaml looks like this:

remoteAuth:
  enabled: true
  backend: "django3_saml2_nbplugin.backends.SAML2CustomAttrUserBackend"
  autoCreateUser: true

pluginsConfig:
  django3_saml2_nbplugin:
    AUTHENTICATION_BACKEND: "django3_saml2_nbplugin.backends.SAML2CustomAttrUserBackend"
    ENTITY_ID: "https://netbox.example.org"
    ASSERTION_URL: "https://netbox.example.org"
    METADATA_AUTO_CONF_URL: "my_url"
    CUSTOM_ATTR_BACKEND:
      USERNAME_ATTR: emailAddress
      MAIL_ATTR: emailAddress
      FIRST_NAME_ATTR: givenName
      LAST_NAME_ATTR: surname
      GROUP_ATTR: groups
      FLAGS_BY_GROUP:
        is_superuser: "superuser"
      GROUP_MAPPINGS:
        "read": "netboxr"
        "write": "netboxrw"

The is a csrf and a sessionid cookie set but still no login.

Does anyone have an idea or did face a similar issue? Thanks in advance!

ProbstenHias commented 7 months ago

I switched over the authentication backend to the default netbox.authentication.RemoteUserBackend and it works now. Of course that also means that the custom attributes do not work anymore.

ProbstenHias commented 7 months ago

Figured it out by myself. Sorry for the noise. The problem was that the backend: field in my helm chart expected a list while I provided a value.