Make sure that OKTA return group names, and that those groups exists in netbox/admin/groups.
# Remote authentication support
REMOTE_AUTH_ENABLED = True
REMOTE_AUTH_BACKEND = 'django3_saml2_nbplugin.backends.SAML2CustomAttrUserBackend'
REMOTE_AUTH_HEADER = 'HTTP_REMOTE_USER'
REMOTE_AUTH_AUTO_CREATE_USER = True
REMOTE_AUTH_DEFAULT_GROUPS = ['']
REMOTE_AUTH_DEFAULT_PERMISSIONS = {}
PLUGINS = ['django3_saml2_nbplugin']
PLUGINS_CONFIG = {
'django3_saml2_nbplugin': {
# Use the Netbox default remote backend
'AUTHENTICATION_BACKEND': REMOTE_AUTH_BACKEND,
# Custom URL to validate incoming SAML requests against
# Populates the Issuer element in authn reques e.g defined as "Audience URI (SP Entity ID)" in SSO
# Metadata is required, choose either remote url
# Settings for SAML2CustomAttrUserBackend. Optional.
'CUSTOM_ATTR_BACKEND': {
# Attribute containing the username. Optional.
# Attribute containing the user's email. Optional.
# Attribute containing the user's first name. Optional.
# Attribute containing the user's last name. Optional.
# Set to True to always update the user on logon
# from SAML attributes on logon. Defaults to False.
'ALWAYS_UPDATE_USER': True,
# Attribute that contains groups. Optional.
# Dict of user flags to groups.
# If the user is in the group then the flag will be set to True. Optional.
'FLAGS_BY_GROUP': {
'is_staff': 'role-sg-netbox-admins',
'is_superuser': 'role-sg-netbox-admins'
},
# Dict of SAML groups to NetBox groups. Optional.
# Groups must be created beforehand in NetBox.
'GROUP_MAPPINGS': {
'role-sg-netbox-users': 'role-sg-netbox-users'
}
}
}
}
In OKTA, make sure to set the 'Name Format' of the attributes to 'URI Reference' and use the URI's of above