Skip to content

Conversation

@sanjuthomas
Copy link

@sanjuthomas sanjuthomas commented Oct 15, 2025

Please refer to the original proposal to learn more about the Dynamic Client Registration and its needs in Vert.x.

This PR contains changes to implement RFC-7591 for Vert.x OAuth. Just so you know, this implementation has been tested with Keycloak for the Client Authenticated Registration Flow mentioned here.

This implementation supports two optional "manage registration flows" for reading and deleting a client.

I would start with the integration test case DCRKeycloak25_0_0_IT to get a jumpstart with this PR.

@sanjuthomas
Copy link
Author

sanjuthomas commented Oct 15, 2025

@pmlopes - thank you! I'm looking forward to hearing from others in the community.

@pmlopes pmlopes requested review from pmlopes and vietj October 15, 2025 11:44
@vietj vietj added this to the 5.1.0 milestone Oct 15, 2025
@vietj
Copy link
Member

vietj commented Nov 12, 2025

@sanjuthomas I'll have a look at the PR soon-ish, the goal is to make it for 5.1

});
}

private Future<DCRResponse> constructResponse(SimpleHttpResponse response, int expectedStatusCode) {
Copy link
Contributor

@pendula95 pendula95 Nov 13, 2025

Choose a reason for hiding this comment

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

Error handling should be included at minimum with support for error and error_description as stated by the https://datatracker.ietf.org/doc/html/rfc7591#section-3.2.2


@DataObject
@JsonGen(publicConverter = false)
public class DCRRequest {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to include all possible values that are listed in https://datatracker.ietf.org/doc/html/rfc7591#section-2
This is a finite list so possibility to have these configured is a must, as with current options no real world usage of this this implementation is possible.

Copy link
Author

@sanjuthomas sanjuthomas Nov 19, 2025

Choose a reason for hiding this comment

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

@pendula95 - Keycloak exposes two endpoints to create clients.

  1. /realms/{realm}/clients-registrations/default
  2. /realms/{realm}/clients-registrations/openid-connect

The second one accepts the attributes mentioned here -> https://datatracker.ietf.org/doc/html/rfc7591#section-2 with the same names and naming conventions.

We initially decided to use /realms/{realm}/clients-registrations/default - I think it supports most, if not all, of the attributes mentioned in the spec, but with a different naming convention. I was wondering which one we should shoot for?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather go for the second one since it aligns with the spec and makes this component generic (not highly coupled to keycloak)

Copy link
Author

Choose a reason for hiding this comment

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

There is a discrepancy in how Keycloak handles the registration and get endpoints. The registration endpoint returns results in snake case, but the get endpoint returns them in camel case. This behavior will force us to maintain two POJOS or write a custom JSON parser.

/realms/{realm}/clients-registrations/openid-connect
/realms/master/clients-registrations/default/{client_id}

@pendula95 - any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, looks like Keycloak DefaultClientRegistrationProvider camel snake case POJOs and OIDCClientRegistrationProvider uses snake case.
As I am not aware of the agreements that were made before this PR on which one to implement, I would suggest to implement OIDC one as it is more generic and should be supported by other servers as well. If you want to implement both then I would go for maintaining 2 sets of POJOs.

*/
@VertxGen
public interface ClientRegistrationProvider {
Future<DCRResponse> create(String clientId);
Copy link
Contributor

Choose a reason for hiding this comment

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

Better provide a way to create a client with client metada data (DCRRequest) then just passing just a client id


@DataObject
@JsonGen(publicConverter = false)
public class DCRResponse {
Copy link
Contributor

Choose a reason for hiding this comment

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

Possibly provide a structure that will capture all meta data returned by the auth server as in advance all possible fields can not be know but should be parsed by the client.

*
*/
@VertxGen
public interface ClientRegistrationProvider {
Copy link
Contributor

Choose a reason for hiding this comment

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

@vietj
Copy link
Member

vietj commented Dec 11, 2025

what is the status of this PR ?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants