Skip to content

JwtDecodersTests and ClientRegistrationsTest should explicitly test for trailing slash #6234

Closed
@jzheaux

Description

@jzheaux

From the Open ID Discovery Spec:

If the Issuer value contains a path component, any terminating / MUST be removed before appending /.well-known/openid-configuration.

Coincidentally, this is taken care of by virtue of using UriComponentsBuilder, which both JwtDecoders and ClientRegistrations (via RestTemplate) use.

And, MockWebServer automatically adds a trailing slash to its base path, which means that JwtDecodersTests and ClientRegistrationsTest have been testing this scenario implicitly all along.

We should add at least one explicit test to each of these that confirms that when the issuer contains a slash at the end, then these classes still work correctly. This way, if these classes stop using MockWebServer then that specific behavior will continue to be tested.

Related to spring-projects/spring-boot#15324

Metadata

Metadata

Assignees

Labels

in: testAn issue in spring-security-testtype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions