Skip to content
Discussion options

You must be logged in to vote

Short version: you probably don't need a plugin at all, and the hook you're aiming at wouldn't work anyway. The gateway never extracts a teams claim from an IdP-issued access token, so there is no "before" point to hook into.

Why the resolve-user hook approach won't work

Two things in the code rule it out:

  • _resolve_plugin_authenticated_user_sync in mcpgateway/auth.py is what consumes whatever your http_auth_resolve_user plugin returns. It keys off email, looks the user up in the DB, and returns the DB record (falling back to a non-admin virtual user only when REQUIRE_USER_IN_DB=false). Teams are not read from the hook result at all, so there is nothing you can set there to influence team…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by schaefec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants