-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement helper method to retrieve token_endpoint_auth_methods #1770
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
Implement helper method to retrieve token_endpoint_auth_methods #1770
Conversation
…Auth Authorization Server Metadata
| Doorkeeper.configure do | ||
| orm DOORKEEPER_ORM | ||
| client_credentials :from_digest, :from_params | ||
| client_credentials :from_basic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:from_digest was never a "supported" client authentication method, from what I can tell, so instead I've switched this to an actually supported client authentication method. (I looked through the git history for https://github.com/doorkeeper-gem/doorkeeper/blob/main/lib/doorkeeper/oauth/client/credentials.rb )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. We have some longstanding issue for digest auth
|
My gut feeling here is that we may need to introduce a "ClientAuthentication Registry" like we have a GrantFlow Registry, and then we evaluate those for figuring it out, deprecating Currently Doorkeeper OpenID hardcodes these values too: https://github.com/doorkeeper-gem/doorkeeper-openid_connect/blob/master/app/controllers/doorkeeper/openid_connect/discovery_controller.rb#L45-L48 However, OpenID also defines the |
This seems to be very old page, I checked UPD: or actually we can 🤔 |
|
@nbulaj what do you think of this idea for being able to register different client authentication mechanisms? That'd give an upgrade path for people using the block syntax — just write & register a custom client authentication mechanism. Also, from what I can tell 'none' for public clients (non-confidential ones) is always an option? (This is currently handled by supporting |
|
Yeah this sounds great to me @ThisIsMissEm 👍 |
@nbulaj good! Because it's already mostly implemented in #1772 |
|
Closing this as it's better implemented by #1772 |

Summary
Whilst getting back to Mastodon OAuth work, I remembered that we didn't have a method to retrieve the configured
token_endpoint_auth_methodsfor OAuth Authorization Server Metadata (RFC 8414), and we needed to hard-code this in mastodon.Having a helper to determine which client authentication methods are supported is helpful for implementing RFC 8414 (there's WIP for this in #1587 / PR #1737 )
Essentially the
client_credentialsoption maps totoken_endpoint_auth_methodsin the OAuth Authorization Server Metadata per the IANA registry and the Dynamic Client Registration RFC (linked below)I do note that this current implementation doesn't really support extensibility, even though additional methods like
private_key_jwthave been registered.(The dynamic client registration spec is the thing that actually defined
none,client_secret_basic, andclient_secret_postas methods: https://www.rfc-editor.org/rfc/rfc7591.html#section-2 )Other Information
I'm not sure if this documentation page is correct, which implies
client_credentialsoption can be a proc/method: https://github.com/doorkeeper-gem/doorkeeper/wiki/Changing-how-clients-are-authenticatedIf that is the case, we may need an alternative mechanism for this.