OIDC Integration: Supports Authentik officially, other solutions currently untested. Social login not implemented
This commit is contained in:
1 parent
dfea7e869b
commit
68bbb53976
28 files changed
+2365
-751
No files matched your search
@@ -24,6 +24,12 @@ class UserAdmin(BaseUserAdmin, ModelAdmin):
|
||||
compressed_fields = True
|
||||
warn_unsaved_form = True
|
||||
|
||||
def get_readonly_fields(self, request, obj=None):
|
||||
readonly = list(super().get_readonly_fields(request, obj))
|
||||
if obj:
|
||||
readonly.extend(["email"])
|
||||
return tuple(dict.fromkeys(readonly))
|
||||
|
||||
|
||||
@admin.register(Group)
|
||||
class GroupAdmin(BaseGroupAdmin, ModelAdmin):
|
||||
|
||||
@@ -10,10 +10,15 @@ def dashboard_status(request):
|
||||
oidc_configured = bool(
|
||||
getattr(settings, "OIDC_RP_CLIENT_ID", None)
|
||||
and getattr(settings, "OIDC_RP_CLIENT_SECRET", None)
|
||||
and getattr(settings, "OIDC_OP_AUTHORIZATION_ENDPOINT", None)
|
||||
and getattr(settings, "OIDC_OP_TOKEN_ENDPOINT", None)
|
||||
and getattr(settings, "OIDC_OP_USER_ENDPOINT", None)
|
||||
and getattr(settings, "OIDC_OP_JWKS_ENDPOINT", None)
|
||||
and (
|
||||
getattr(settings, "OIDC_OP_DISCOVERY_ENDPOINT", None)
|
||||
or (
|
||||
getattr(settings, "OIDC_OP_AUTHORIZATION_ENDPOINT", None)
|
||||
and getattr(settings, "OIDC_OP_TOKEN_ENDPOINT", None)
|
||||
and getattr(settings, "OIDC_OP_USER_ENDPOINT", None)
|
||||
and getattr(settings, "OIDC_OP_JWKS_ENDPOINT", None)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
return {
|
||||
@@ -23,7 +28,7 @@ def dashboard_status(request):
|
||||
"group_count": group_count,
|
||||
"has_superuser": has_superuser,
|
||||
"oidc_configured": oidc_configured,
|
||||
"social_configured": bool(getattr(settings, "KEYWARDEN_SOCIAL_AUTH_ENABLED", False)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user