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

support multiple subjects in oidc ping #4475

Merged

Conversation

RobKenis
Copy link
Contributor

@RobKenis RobKenis commented Oct 8, 2024

Validate the subject in an oidc ping against a list of logged in subjects.

This resolves the issue that multiple connected FRP clients with different OIDC clients result in a failing ping. The ping would fail because the subject in memory would be the value of the last logged in FRPC.

This change also changes the constructor of OidcAuthVerifier to take a TokenVerifier interface. This will not change production behavior, but makes testing easier because we can inject a mock verifier during testing.

Resolves: #4466

@RobKenis RobKenis force-pushed the feature/support-multiple-oidc-clients branch from 54259a8 to 98658a9 Compare October 8, 2024 13:52
@blizard863 blizard863 self-requested a review October 9, 2024 02:10
@blizard863
Copy link
Collaborator

blizard863 commented Oct 10, 2024

I think it may be a bug, I test your code and find some RFC doc, your changes may be correct.

In a machine-to-machine (M2M) authentication scenario, different clients typically have different subjects because each client usually represents a distinct application or service.

blizard863
blizard863 previously approved these changes Oct 10, 2024
@blizard863
Copy link
Collaborator

You need to sort packages to pass CI. @RobKenis

@blizard863
Copy link
Collaborator

The CI errors in the pull request are due to issues found by golangci-lint. Specifically, the following errors were reported:

  1. Files not gci-ed with certain flags.
  2. Files not gofumpt-ed.

To fix these errors, you need to:

  1. Ensure that your Go files are formatted using gci with the appropriate flags (--skip-generated -s standard -s default -s prefix(github.com/fatedier/frp/)).
  2. Ensure that your Go files are formatted using gofumpt.

You can use the following commands to fix the issues:

gci write --skip-generated -s standard -s default -s prefix(github.com/fatedier/frp/) ./path/to/your/files
gofumpt -w ./path/to/your/files

After making these changes, commit the updates and push them to your branch to re-run the CI checks.

Validate the subject in an oidc ping against a list of logged in subjects.

This resolves the issue that multiple connected FRP clients with different
OIDC clients result in a failing ping. The ping would fail because the
subject in memory would be the value of the last logged in FRPC.

This change also changes the constructor of OidcAuthVerifier to take
a TokenVerifier interface. This will not change production behavior, but makes
testing easier because we can inject a mock verifier during testing.

Resolves: fatedier#4466
@RobKenis
Copy link
Contributor Author

@blizard863 I have updated the commit after formatting the code

@blizard863 blizard863 merged commit 2466e65 into fatedier:dev Oct 12, 2024
2 checks passed
github-actions bot added a commit to aiastia-dockerhub/frp that referenced this pull request Oct 12, 2024
@RobKenis RobKenis deleted the feature/support-multiple-oidc-clients branch October 14, 2024 07:53
aircross pushed a commit to aircross/frp that referenced this pull request Oct 15, 2024
@RobKenis
Copy link
Contributor Author

RobKenis commented Nov 7, 2024

@fatedier @blizard863 Sorry to bother you. Do you have an idea on when this going to be released?

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.

Invalid ping with multiple clients using OIDC
2 participants