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

deviceflow: ignore client secret for public clients #178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Snaipe
Copy link
Member

@Snaipe Snaipe commented May 3, 2023

RFC8628 section 3.11 mandates that client secrets cannot be passed to the device authorization endpoint, meaning that dex is doing the wrong thing by checking them.

By definition, it does not really make sense for confidential (i.e. non-public) clients to use the device flow, as there are more appropriate flow for their use case. CLI and other applications where the device flow make sense cannot hide the client id & secret that they have to access or embed somewhere, making clients impossible to stay confidential.

Therefore, this commit removes the client secret comparison in the device flow for public clients. I left the logic intact for confidential clients as it would most likely break some of the assumptions we have, but a real fix should likely make the entire check go away with a feature flag.

I am waiting on more information from the upstream maintainers of dex before doing anything better than this though. For now, this fix is sufficient for our own needs.

RFC8628 section 3.1[1] mandates that client secrets cannot be passed to
the device authorization endpoint, meaning that dex is doing the wrong
thing by checking them.

By definition, it does not really make sense for confidential
(i.e. non-public) clients to use the device flow, as there are more
appropriate flow for their use case. CLI and other applications where
the device flow make sense cannot hide the client id & secret that they
have to access or embed somewhere, making clients impossible to stay
confidential.

Therefore, this commit removes the client secret comparison in the
device flow for public clients. I left the logic intact for confidential
clients as it would most likely break some of the assumptions we have,
but a real fix should likely make the entire check go away with a
feature flag.

I am waiting on more information from the upstream maintainers of dex
before doing anything better than this though. For now, this fix is
sufficient for our own needs.

[1]: https://datatracker.ietf.org/doc/html/rfc8628#section-3.1
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.

1 participant