Skip to content

Using the SecurityMockServerConfigurers.java requires the com.nimbusds oauth2-oidc-sdk on the classpath #9923

@frommeyerc

Description

@frommeyerc

Describe the bug
When using the SecurityMockServerConfigurer e.g. to test with an opaque OAuth2 token tests fail due to an NoClassDefFoundError. The root of the error is that in the SecurityMockServerConfigurer the `StringUtils from the com.nimbusds oauth2-oidc-sdk are used. This is an optional dependency of spring-security and in our case, where we're not dealing with oidc, not on the classpath.

Currently the Workaround is to add the sdk to the dependencies, but that should not be necessary.

To Reproduce
Use SecurityMockServerConfigurer#mockOpaqueToken in a project that has no dependency to the oauth2-oidc-sdk.

Expected behavior
Dependency should not be mandatory for unrelated functionality.

Metadata

Metadata

Assignees

Labels

in: testAn issue in spring-security-teststatus: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions