Re: Getting provider/properties from jaspic-providers.xml to my ServerAuthModule

2024-02-08 Thread Mark Thomas

On 08/02/2024 14:37, Ryan Esch wrote:

I'm using Tomcat 9. I have a provider in jaspic-providers.xml:





I am not sure how to get these properties to my
ServerAuthModule. I have a ServletContextListener and can see that the
jaspic-providers.xml file is being processed if I call:
AuthConfigFactory factory = AuthConfigFactory.getFactory()

It looks like
  I need to get the properties from the factory before calling:
factory.registerConfigProvider(
        new SimpleAuthConfigProvider(props, factory),
        "HttpServlet", null,
      "test");

I can't figure out how to get the properties from the
provider in the xml. If I hardcode the properties before passing them
into registerConfigProvider, the ServerAuthModule functions correctly.
Thanks!


You shouldn't need to call factory.registerConfigProvider() at all. That 
should happen automatically.


Are you sure the appContext is correct. The context path for the ROOT 
web application is "" (the empty string), not "/".


That would make the appContext "Catalina/localhost ".

Note that means it will only be applied to the ROOT web application.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Getting provider/properties from jaspic-providers.xml to my ServerAuthModule

2024-02-08 Thread Ryan Esch
I'm using Tomcat 9. I have a provider in jaspic-providers.xml:
                I am not sure how to get these properties to my 
ServerAuthModule. I have a ServletContextListener and can see that the 
jaspic-providers.xml file is being processed if I call:
AuthConfigFactory factory = AuthConfigFactory.getFactory();It looks like I need 
to get the properties from the factory before calling:
factory.registerConfigProvider(        new SimpleAuthConfigProvider(props, 
factory),        "HttpServlet", null,        "test");I can't figure out how to 
get the properties from the provider in the xml. If I hardcode the properties 
before passing them into registerConfigProvider, the ServerAuthModule functions 
correctly.
Thanks!