Skip to content

Conversation

jpsfs
Copy link
Contributor

@jpsfs jpsfs commented Aug 20, 2025

Pull Request Template

Summary

This Pull Request implements #9167 .
The goal is to allow a user that logins OIDC to be an admin in LibreChat depending on a claim that can exist in either the access_token, id_token or it's user profile.

A PR for the documentation was also open, detailing 3 new env vars, similar to the ones already used to check required roles.

OPENID_ADMIN_ROLE=
OPENID_ADMIN_ROLE_PARAMETER_PATH=
OPENID_ADMIN_ROLE_TOKEN_KIND=

Change Type

Please delete any irrelevant options.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

Depending on your OIDC provider configurations might be different.
If you have a claim in the id_token called roles that's an array, and an admin user must have a role called admin, the configuration would be the following:

OPENID_ADMIN_ROLE=admin
OPENID_ADMIN_ROLE_PARAMETER_PATH=roles
OPENID_ADMIN_ROLE_TOKEN_KIND=id

Test Configuration:

Checklist

Please delete any irrelevant options.

@jpsfs jpsfs changed the title feat: Add support for users to be admins when logging in using OpenID 🔑 feat: Add support for users to be admins when logging in using OpenID Aug 20, 2025
@danny-avila
Copy link
Owner

Thanks, please address ESLint issues

@jpsfs
Copy link
Contributor Author

jpsfs commented Aug 20, 2025

@danny-avila Run lint:fix and pushed it again. Couldn't understand most of initial errors.

@jpsfs
Copy link
Contributor Author

jpsfs commented Aug 20, 2025

@danny-avila know I think it's all :)

@jpaodev
Copy link

jpaodev commented Aug 22, 2025

Very cool, I think this makes a lot of sense as alternative and would be a neat upgrade from the current version (first user receives update)

@danny-avila danny-avila changed the base branch from main to dev August 27, 2025 07:31
@jpsfs
Copy link
Contributor Author

jpsfs commented Aug 29, 2025

Hi @danny-avila !
Are you open to merging this one? Just need this one to close my fork for now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants