无法为 django admin 中的 auth0 用户获取组和权限

问题描述

我正在使用 Auth0 身份验证并允许用户登录管理站点。但是,我无法获得与这些用户一起工作的 django 组和权限。用户正在保存到 auth_user 表。我正在使用带有 auth0 的 social_django。

这里是身份验证后端、登录、注销 URL 的简要说明。

# declaring authentication backends for auth0 users
AUTHENTICATION_BACKENDS = {
    'django.contrib.auth.backends.ModelBackend','core.authentication.auth0.Auth0'
}

##### Login and logout Urls and Redirections
LOGIN_URL = '/login/auth0'
LOGIN_REDIRECT_URL = '/admin'
logoUT_REDIRECT_URL = '/login/auth0'

# social auth pipeline

SOCIAL_AUTH_PIPELINE = (
    'social_core.pipeline.social_auth.social_details','social_core.pipeline.social_auth.social_uid','social_core.pipeline.social_auth.auth_allowed','social_core.pipeline.social_auth.social_user','social_core.pipeline.user.get_username','social_core.pipeline.user.create_user','core.authentication.authorization.process_roles','social_core.pipeline.social_auth.associate_user','social_core.pipeline.social_auth.load_extra_data','social_core.pipeline.user.user_details',)

如果我禁用超级用户状态,即使分配到组后,员工用户也无法访问管理站点中的任何内容。我想将用户添加一个组并允许基于此访问。 此外,我还没有在 django 端创建任何自定义用户模型来读取用户

我应该使用自定义用户模型进行 auth0 身份验证吗?

这方面的任何指导都会非常有帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)