feat: Fetch OIDC claims in the pipeline #5157

Closed
opened 2025-11-11 16:13:27 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @aakritichoudhary on GitHub (May 13, 2025).

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

I am using OpenWebUI v0.6.5 with OIDC OAuth for SSO. I want to fetch my OIDC claims in the pipeline.
My inlet looks like -

 async def inlet(self, body: dict, user: dict) -> dict:
        # This function is called before the OpenAI API request is made. You can modify the form data before it is sent to the OpenAI API.
        print(f"inlet:{__name__}")
        print(f"UserInlet: {user}")
        return body

Output Log of the pipeline -

inlet:test-aakriti

UserInlet: {'id': '<some-encrypted-id>', 'email': '<my-email>', 'name': '<my-name>', 'role': 'admin'}
//---returned body (but no OIDC claims)---

Claims passed in the .env -

OAUTH_USERNAME_CLAIM=firstName
OAUTH_EMAIL_CLAIM=email
OAUTH_ID_CLAIM=uid
OIDC_SCOPES=openid profile LDAPGroups

Desired Solution you'd like

I would want to return all the scopes and claims passed in the user inlet. One way I tried was to modify the inlet code in the open-webui code (not the pipeline code), but that did not help.
Please let me know if there are any other issues that I can look to, have looked at most of them but no luck.
TIA!

Alternatives Considered

No response

Additional Context

No response

Originally created by @aakritichoudhary on GitHub (May 13, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description I am using OpenWebUI v0.6.5 with OIDC OAuth for SSO. I want to fetch my OIDC claims in the pipeline. My inlet looks like - ``` async def inlet(self, body: dict, user: dict) -> dict: # This function is called before the OpenAI API request is made. You can modify the form data before it is sent to the OpenAI API. print(f"inlet:{__name__}") print(f"UserInlet: {user}") return body ``` Output Log of the pipeline - ``` inlet:test-aakriti UserInlet: {'id': '<some-encrypted-id>', 'email': '<my-email>', 'name': '<my-name>', 'role': 'admin'} //---returned body (but no OIDC claims)--- ``` Claims passed in the .env - ``` OAUTH_USERNAME_CLAIM=firstName OAUTH_EMAIL_CLAIM=email OAUTH_ID_CLAIM=uid OIDC_SCOPES=openid profile LDAPGroups ``` ### Desired Solution you'd like I would want to return all the scopes and claims passed in the user inlet. One way I tried was to modify the inlet code in the open-webui code (not the pipeline code), but that did not help. Please let me know if there are any other issues that I can look to, have looked at most of them but no luck. TIA! ### Alternatives Considered _No response_ ### Additional Context _No response_
Author
Owner

@aakritichoudhary commented on GitHub (May 14, 2025):

Modified few files to get claims via the GET /api/v1/auths endpoint, but only extra field that is coming is oauth_sub, not other field. If I can get other OIDC claims in this endpoint, it will be helpful.

@aakritichoudhary commented on GitHub (May 14, 2025): Modified few files to get claims via the ```GET /api/v1/auths``` endpoint, but only extra field that is coming is oauth_sub, not other field. If I can get other OIDC claims in this endpoint, it will be helpful.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#5157