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

fix: pass standard params to storage #791

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Conversation

aeneasr
Copy link
Member

@aeneasr aeneasr commented Feb 3, 2024

Related Issue or Design Document

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact security@ory.sh) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Further comments

@aeneasr aeneasr merged commit 505fb24 into master Feb 13, 2024
7 checks passed
@aeneasr aeneasr deleted the standard-allow-params branch February 13, 2024 08:58
@@ -159,10 +159,12 @@ func (a *Request) Merge(request Requester) {
}
}

var defaultAllowedParameters = []string{"grant_type", "response_type", "scope", "client_id"}
Copy link
Contributor

Choose a reason for hiding this comment

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

In my own code, I use the following list:

			"max_age", "prompt", "acr_values", "id_token_hint", "nonce",
			// PCRE.
			"code_challenge", "code_challenge_method",
			// Other fields.
			"display", "ui_locales", "login_hint",

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, this is not really a "default" list (you cannot set it to non-default) but an "always allowed list".

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW, this is not really a "default" list (you cannot set it to non-default) but an "always allowed list".

True :)

I would probably drop id_token_hint because it contains a valid ID token

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, thanks. You are right. I am storing that to support logout. But I should just store the subject ID, not the whole token.

Copy link
Contributor

Choose a reason for hiding this comment

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

In fact, id_token_hint is from this list in fosite: https://github.com/ory/fosite/blob/master/handler/openid/flow_explicit_auth.go#L29-L35

So if you are saying this should not be stored into the database? Because fosite currently does so:

	if err := c.OpenIDConnectRequestStorage.CreateOpenIDConnectSession(ctx, resp.GetCode(), ar.Sanitize(oidcParameters)); err != nil {
		return errorsx.WithStack(fosite.ErrServerError.WithWrap(err).WithDebug(err.Error()))
	}

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this means that subject should be extracted out earlier from the id_token_hint instead of being passed to the store inside form?

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.

2 participants