Skip to content
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

Add user_profile_method to upstream SSO provider #3363

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MatMaul
Copy link

@MatMaul MatMaul commented Oct 15, 2024

Untested for now so I am keeping it as a draft.


let env = {
let mut env = environment();
env.add_global("user", minijinja::Value::from_serialize(&id_token));
env.add_global("user", userinfo);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking out loud at this point, but it would be nice to have both the userinfo and the idtoken claims in the environment.

I don't know what the right config is to tell whether to fetch userinfo or not for example, but I would set userinfo_claims in the template environment if we fetched it, id_token_claims if we have an id_token and user being somehow a merge of the two?

One stretch goal of this would be for this to work with non-OIDC OAuth 2.0 providers, like GitHub, so we'd need to remove the id_token requirement at some point as well

ADD COLUMN "userinfo_endpoint_override" TEXT;

ALTER TABLE "upstream_oauth_authorization_sessions"
ADD COLUMN "userinfo" TEXT;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ADD COLUMN "userinfo" TEXT;
ADD COLUMN "userinfo" JSONB;

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.

Allow fetching user claims through the userinfo_endpoint on upstream OAuth 2.0 logins
2 participants