mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #17183] feat: Allow Passing OAuth Token to Tool Calls #18199
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @koflerm on GitHub (Sep 3, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/17183
Originally assigned to: @tjbck on GitHub.
Check Existing Issues
Problem Description
We want to pass the identity, to be concrete the oauth token returned via the SSO login, to the tool calls. This is required as we query information from our data sources via the tools and would like to ensure the user only gets information returned which he/she is allowed to see.
Desired Solution you'd like
The desired solution would be to have the oauth token available in the tool code in order to pass this token as part of the requests to external systems, which can then use the token to verify the user identity.
Alternatives Considered
I did not find any alternative solutions how this would work so far. Appreciated if anybody knows a solution how to handle this.
Additional Context
No response
@tjbck commented on GitHub (Sep 3, 2025):
Related: https://github.com/open-webui/open-webui/discussions/8957 https://github.com/open-webui/open-webui/issues/17178
@jrkropp commented on GitHub (Sep 4, 2025):
This is how I got around the refresh token issue. https://github.com/jrkropp/open-webui-developer-toolkit/tree/development/tools/microsoft_365_tool
@koflerm commented on GitHub (Sep 4, 2025):
Great I did not know you can inject the
__request__parameter in the tool methods. With that I was able now to extract the OAuth token from the cookies using this code:Thanks @jrkropp for the reference to your code!
I think it would be great to add this information to the documentation, so that
__request__can be injected. I can add a pull request to do this if you guys agree this makes sense.@tjbck commented on GitHub (Sep 4, 2025):
We might deprecate the cookie option due to https://github.com/open-webui/open-webui/issues/17178
@jrkropp commented on GitHub (Sep 4, 2025):
@koflerm commented on GitHub (Sep 5, 2025):
@tjbck Just checked #17210 and if this feature request is added, that should definitely solve my problem even better then using the cookies. Looking forward to it!
@tjbck commented on GitHub (Sep 8, 2025):
Addressed in dev (
__oauth_token__reserved param added), testing wanted here!