Skip to content

ClientRegistrationsTests assertions should compute the hostname from the issuer #9748

@jzheaux

Description

@jzheaux

ClientRegistrationsTests asserts the following

MockWebServer server;
// ...
assertThat(registration.getRegistrationId()).isEqualTo(this.server.getHostName());

This works coincidentally when the hostname is all lower-case. However, due to a nuance between how MockWebServer computes the hostname and the URL, this check fails when the hostname has mixed case.

Instead, the test should compute the hostname from the issuer, which is the same thing that ClientRegistrations does when determining the default registrationId:

assertThat(registration.getRegistrationId()).isEqualTo(URI.create(this.issuer).getHost());

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions