You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spring Boot + spring-security-oauth2-resource-server should not throw a ClassNotFoundException once it supports more than one token formatΒ #6209
While it's true that Resource Server effectively requires spring-security-oauth2-jose at this point, it shouldn't once it supports more than one token format.
When spring-boot-starter-security and spring-security-oauth2-resource-server are used together, without further configuration, the application throws the following exception:
Caused by: java.lang.ClassNotFoundException: org.springframework.security.oauth2.jwt.JwtDecoder
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 111 more
In all likelihood, this will be taken care of naturally when coordinating with the boot team to add support for a second token format.
changed the title [-]Spring Boot + spring-security-oauth2-resource-server throws ClassNotFoundException on startup[/-][+]Spring Boot + spring-security-oauth2-resource-server should not throw a ClassNotFoundException once it supports more than one token format[/+]on Dec 1, 2018
Thanks for the tip, @rwinch, about the starter. Agreed that including the starter is simpler, especially since spring-security-oauth2-jose is effectively required right now, even though resource server lists it as an optional dependency.
Are you thinking that its okay to throw a ClassNotFoundException when a user uses spring-boot-starter-security and spring-security-oauth2-resource-server (instead of the starter you mentioned)? I think it's okay for now since resource server only supports JWT. But once resource server supports more than one token format, I think this exception would confuse users.
I re-titled the issue for clarity, but I think it's kind of gangly. Suggestions welcome.
Activity
rwinch commentedon Dec 1, 2018
@jzheaux There is a spring-boot-starter-oauth2-resource-server that should resolve this. There is a ticket for adding it to start.spring.io
[-]Spring Boot + spring-security-oauth2-resource-server throws ClassNotFoundException on startup[/-][+]Spring Boot + spring-security-oauth2-resource-server should not throw a ClassNotFoundException once it supports more than one token format[/+]jzheaux commentedon Dec 1, 2018
Thanks for the tip, @rwinch, about the starter. Agreed that including the starter is simpler, especially since
spring-security-oauth2-joseis effectively required right now, even though resource server lists it as an optional dependency.Are you thinking that its okay to throw a
ClassNotFoundExceptionwhen a user usesspring-boot-starter-securityandspring-security-oauth2-resource-server(instead of the starter you mentioned)? I think it's okay for now since resource server only supports JWT. But once resource server supports more than one token format, I think this exception would confuse users.I re-titled the issue for clarity, but I think it's kind of gangly. Suggestions welcome.
rwinch commentedon Dec 3, 2018
It seems like that would be the case. Won't that naturally sort itself out or is this just to ensure we validate that?
jzheaux commentedon Dec 5, 2018
This is just to ensure we validate that. Agreed that it should naturally sort itself out.
edeandrea commentedon Dec 11, 2018
The Spring Boot team is doing a check on their side as well (see spring-projects/spring-boot#15372).
jzheaux commentedon Sep 4, 2019
Confirmed by creating a project using the describing configuration and observing that it ran without error.