The previous version of our project was written with Jetty 9. In that version, we needed a customized SPNEGO authenticator, and instead of extending SPNEGOuthenticator class, we implemented this part of our business with filters.
Now we are upgrading Jetty version from 9 to 12. In this conversion, we encountered this problem. Friends advised us to write this authentication with Jetty Authenticators itself. So we removed the Filter and decided to use org.eclipse.jetty.security.authentication.SPNEGOAuthenticator
and customize validateRequest()
method belonging to it.
For this purpose, I created a class in my project that extends SPNEGOAuthenticator
class and override that validateRequest()
method.
public class MySPNEGOAuthenticator extends SPNEGOAuthenticator{
private String error401Page;
@override
public AuthenticationState validateRequest(Request req, Response res, Callbak callback) throws ServerAuthException{
//code
}
}
After a lot of searching, I realized that one of the ways to add this authenticator to Jetty is to create a jar
file and introduce it to Jetty in the form of a module
during project deployment.
now my question is:
in our web.xml settings in previous version, we had specified <url-pattern>/spnego/*</url-pattern>
for this filter. Is it possible to set a url-pattern
for authenticators too?