Skip to content

fix: only allow one authenticate method#858

Open
suqin-haha wants to merge 5 commits intozitadel:mainfrom
suqin-haha:main
Open

fix: only allow one authenticate method#858
suqin-haha wants to merge 5 commits intozitadel:mainfrom
suqin-haha:main

Conversation

@suqin-haha
Copy link
Copy Markdown

@suqin-haha suqin-haha commented Mar 18, 2026

according to the RFC 6749 §2.3 The client MUST NOT use more than one authentication method in each request.

this PR resolve issue #857

  1. add the logic to only have one authenticate method in client side
  2. add the restrict on the OP side to only allow one authenticate method.

NOTE: it's a breaking change since it removes ClientSecretBasicAuthRequest interface and func Auth( code.

test:
added united test

Definition of Ready

  • I am happy with the code
  • Short description of the feature/issue is added in the pr description
    - [ ] PR is linked to the corresponding user story
  • Acceptance criteria are met
    - [ ] All open todos and follow ups are defined in a new ticket and justified
    - [ ] Deviations from the acceptance criteria and design are agreed with the PO and documented.
  • No debug or dead code
  • My code has no repetitions
  • Critical parts are tested automatically
    - [ ] Where possible E2E tests are implemented
    - [ ] Documentation/examples are up-to-date
  • All non-functional requirements are met
    - [ ] Functionality of the acceptance criteria is checked manually on the dev system.

@suqin-haha suqin-haha requested a review from muir March 25, 2026 16:32
@suqin-haha suqin-haha requested a review from muir March 31, 2026 12:54
@muhlemmer
Copy link
Copy Markdown
Collaborator

@wim07101993 can you please review this PR?

@muhlemmer muhlemmer requested review from wim07101993 and removed request for muir March 31, 2026 16:53
Comment on lines -819 to -823
func (r RefreshTokenRequest) Auth(req *http.Request) {
if r.ClientSecret != "" {
req.SetBasicAuth(r.ClientID, r.ClientSecret)
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Removing this method creates a breaking change. Both in changing the public api and removing the implementation of the ClientSecretBasicAuthRequest interface. Wouldn't there be another solution without breaking changes?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

it's a wrong behavior we should mark the release as broken or bug ASAP.

I don't have any idea to fix it without breaking change. Does any one have a good migration idea?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@muhlemmer what do you think about this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

any update on that issue?
feel free to bring up migration idea.
Or we might need to make it as a break change release?

@wim07101993
Copy link
Copy Markdown
Member

@suqin-haha thank you for the contribution. Could you have a look at my comments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants