Skip to content

Admin role for access to admin console not respected #48

@Deytron

Description

@Deytron

Kubernetes version: v1.33.3
OIDCWarden version: v2025.8.1-1-alpine

Hello,

When accessing the admin console page with the following config, I am unable to use the mapped group with my SSO user to access the page:

Image

Here's the relevant config:

ORG_GROUPS_ENABLED: "true"
    SSO_SIGNUPS_MATCH_EMAIL: "true"
    SSO_ENABLED: "true"
    SSO_ONLY: "true"
    SSO_AUTHORITY: https://xxx.xxx/application/o/vaultwarden/
    SSO_SCOPES: "openid email profile roles groups offline_access"
    ORGANIZATION_INVITE_AUTO_ACCEPT: "true"
    SSO_ORGANIZATIONS_ENABLED: "true"
    SSO_ORGANIZATIONS_GROUPS_ENABLED: "true"
    SSO_ORGANIZATIONS_TOKEN_PATH: /groups
    SSO_ROLES_ENABLED: "true"
    SSO_ROLES_DEFAULT_TO_USER: "true"
    SSO_ROLES_TOKEN_PATH: /roles
    SSO_ORGANIZATIONS_NAME: "xxx"
    SSO_AUTH_ONLY_NOT_SESSION: "true"
    SSO_ALLOW_UNKNOWN_EMAIL_VERIFICATION: "false"
    SSO_DEBUG_TOKENS: "true"
    LOG_LEVEL: "info,oidcwarden::sso=debug"
    # SSO_CLIENT_CACHE_EXPIRATION: "0"
    SSO_CLIENT_ID:
      secretKeyRef:
        name: oidc
        key: client-id
    SSO_CLIENT_SECRET:
      secretKeyRef:
        name: oidc
        key: client-secret

In Authentik, I am using the following property mapping to map the groups according to my Authentik config:

if any(g.name == "authentik Admins" for g in user.ak_groups.all()):
    return {"groups": ["Admins"], "roles": ["OrgAdmin", "admin"]}
elif... # other org group mappings

When logging in, this returns the following info:

vaultwarden-8f4647cdc-fbqgr vaultwarden [2025-09-17 21:39:14.094][oidcwarden::sso][DEBUG] Authenticated user OIDCAuthenticatedUser { refresh_token: Some("xxx", expires_in: Some(1800s), identifier: OIDCIdentifier("https://xxx.xxx/application/o/vaultwarden//user"), email: "xxx@xxx", email_verified
: Some(true), user_name: Some("user"), role: Some(Admin), org_role: Some(OrgAdmin), groups: Some(["Admins", "authentik Admins", "Other-group"]) }                                                                                                                                                                
vaultwarden-8f4647cdc-fbqgr vaultwarden [2025-09-17 21:39:14.109][oidcwarden::sso][DEBUG] Organization and groups sync for user xxx@xxx with ["Admins", "authentik Admins", "Other-group"]                                                                                                                  
vaultwarden-8f4647cdc-fbqgr vaultwarden [2025-09-17 21:39:14.110][oidcwarden::sso][WARN] Failed to correctly match user groups, revoking will be disabled                                                                                                                                                                    
vaultwarden-8f4647cdc-fbqgr vaultwarden [2025-09-17 21:39:14.110][oidcwarden::sso][WARN] Identifier (Other-group - None)  returned no match                                                                                                                                                                                    
vaultwarden-8f4647cdc-fbqgr vaultwarden [2025-09-17 21:39:14.110][oidcwarden::sso][WARN] Identifier (authentik Admins - None)  returned no match                                                                                                                                                                             
vaultwarden-8f4647cdc-fbqgr vaultwarden [2025-09-17 21:39:14.111][oidcwarden::sso][DEBUG] Matched organizations [("Org", {GroupId("d0129674-2499-4571-a644-d9e798a4f6a5")})]                                                                                                                                           
vaultwarden-8f4647cdc-fbqgr vaultwarden [2025-09-17 21:39:14.118][oidcwarden::api::identity][INFO] User user logged in successfully. IP: XXX.XXX.XXX.XXX                                                                                                                                                        
vaultwarden-8f4647cdc-fbqgr vaultwarden [2025-09-17 21:39:14.119][response][INFO] (login) POST /identity/connect/token => 200 OK 

I see that there's some group and org matching, but I don't get the admin cookie.

Is there somerthing I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions