I am trying to create a custom authenticator in Tomcat 7. So, my understanding is that I need to extend AuthenticatorBase class (similar to FormAuthenticator) and then mention the new authenticator's name in web.xml, something like this:
<login-config>
<auth-method>CUSTOMAUTH</auth-method>
</login-config>
Create a Jar out of the Custom Authenticator class and put it in tomcatDir\lib\
Now where do I mention the mapping between "CUSTOMAUTH" and my class CustomAuthenticator.java which might be in , lets say, com.authentication.custom.CustomAuthenticator.java ?
Could you please let me know the path to the config file for both windows (my dev environment) as well as Linux (our actual servers).
Please correct me if I am wrong about any of the steps above.
Thanks in advance for your time!
You will need to override the method
protected abstract String getAuthMethod();
Here you must return CUSTOMAUTH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With