-
Notifications
You must be signed in to change notification settings - Fork 886
feat: allow storing extra oauth token properties in the database #10152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
extra := map[string]interface{}{} | ||
require.NoError(t, json.Unmarshal(updated.OAuthExtra.RawMessage, &extra)) | ||
mapping, ok := extra["authed_user"].(map[string]interface{}) | ||
require.True(t, ok) | ||
require.Equal(t, updated.OAuthAccessToken, mapping["access_token"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is 100% ok.
I am thinking of maybe exposing an easy way to hit the IDP with a Bearer token that would essentially do this check. The /userinfo
will validate an access token for the request, but oauth2
is a subset of OIDC
and does not have an easy UserInfo
method to call from the token/config.
Just would be a nice helper to have like fake.UserInfo(accessToken string)
or something convenient. Maybe 🤔
Supersedes #10151
These will be accessible via the new
external-auth
command in #10052