com.auth0.AuthenticationController not working for Spring Boot 3.0

Hi

I previously have a Spring Boot 2.7.6 / Java 11 application that used the com.auth0.AuthenticationController to build my Authorize Url.

Moving to Spring Boot 3.0.1 / Java 17, the application now fails because the AuthenticationController uses javax.servlet.http.HttpServletRequest and javax.servlet.http.HttpServletResponse . SpringBoot 3.0 which uses Tomcat 10.0 is expecting jakarta.servlet.http.HttpServletRequest.

I get the “No primary or single unique constructor found for interface javax.servlet.http.HttpServletRequest” error

Now I can use Spring Boot 3.0.1, if I use the spring-boot-starter-oauth2-client library but I really want to use the AuthenticationController as I can append the ui_locales query parameter to the Authorize Url to control localisation of the Auth0 login widget.

When will a Spring Boot 3.0 update be available for the com.auth0.AuthenticationController i.e an update to the mvc-auth-commons jar?

Has anyone found a work around. The key issue is the ability to append the ui_locales to the Authorize URL.

Thanks in advance

Richard

1 Like

Hi All

Here’s my work around for my Spring Boot 3 / Java 17 project

In your project (I use Eclipse), create a package called com.auth0
From the mvc-auth-commons jar file edit the following classes (I pre-appended Auth0 to the class names to ensure no conflicts):

AuthenticationController
AuthorizeUrl
RandomStorage
RequestProcessor
SessionUtils
TransientCookieStore

Change all references of javax.servlet.http to jakarta.servlet.http

For some reason I have to add public to the RandomStorage class because of a visibility issue.

So the bottom line is, Auth0 need to release an update to the mvc-auth-commons jar the current version is 1.9.3.

Good luck

Richard

Hi Richard,

Am facing the same issue, am using spring boot 3, Java 17 and httpclient5.
Can you be more specific on the solutions? Like, any example would be great and appreciated. Thank you.

Hi Rajee

I you find me on LinkedIn and send me a message, then I can send you a zipped file of an example SpringBoot 3.0 app that authenticates with Auth0

Kind regards

Richard

2 Likes

Thank you Richard. This work around helped me out of a bind!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.