----- Original Message -----
From: "Anil Saldhana" <Anil.Saldhana(a)redhat.com>
To: undertow-dev(a)lists.jboss.org
Sent: Monday, 16 December, 2013 4:41:32 PM
Subject: Re: [undertow-dev] AuthenticationMechanism lifecycle
Right now, I just have a junit test. I set the auth mechanism factory
in the deployment info.
di.addAuthenticationMechanism("FORM" ,
SPFormAuthenticationMechanism.FACTORY);
Irrespective of how it is added, when the deployment start happens,
undertow should try to start
the authentication mechanisms by providing a handle to the servlet
context. The authentication mechanism
may need to read deployment descriptors or set up internal resources.
The ServletExtension already has a reference to the ServletContext, you can just pass it
in to your factory.
I guess this is another argument against using the factory, vs just creating it in the
ServletExtension.
Stuart
Regards,
Anil
On 12/16/2013 09:38 AM, Darran Lofthouse wrote:
> How is this authentication mechanism being added?
>
> On 16/12/13 15:33, Anil Saldhana wrote:
>> Hi,
>> can the authentication mechanism have a lifecycle based on the
>> context lifecycle?
>>
>> I need access to the ServletContext to look for deployment descriptors
>> using the servletContext.getResourceAsStream() call.
>>
>> I am thinking something along the lines of:
>>
>> authenticationMechanism.start(ServletContext);
>> authenticationMechanis.stop();
>>
>> This will give an opportunity for the authentication mechanism to
>> initialize and finalize any resources.
>>
>> Regards,
>> Anil
_______________________________________________
undertow-dev mailing list
undertow-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/undertow-dev