[undertow-dev] AuthenticationMechanism lifecycle

Anil Saldhana Anil.Saldhana at redhat.com
Tue Dec 17 11:43:20 EST 2013


On 12/17/2013 09:58 AM, Anil Saldhana wrote:
> On 12/17/2013 09:54 AM, Stuart Douglas wrote:
>> ServletExtension is usable in embedded deployments as well now. I recently added io.undertow.servlet.api.DeploymentInfo#addServletExtension, so you can manually add extensions to the deployment as well as discovering them.
> Do you have any unit tests that I can see the usage?
Never mind. Did some authenticationmechanismfactory magic.
>> Stuart
>>
>>
>>
>> ----- Original Message -----
>>> From: "Anil Saldhana" <Anil.Saldhana at redhat.com>
>>> To: "Stuart Douglas" <sdouglas at redhat.com>
>>> Cc: undertow-dev at lists.jboss.org
>>> Sent: Tuesday, 17 December, 2013 4:43:51 PM
>>> Subject: Re: [undertow-dev] AuthenticationMechanism lifecycle
>>>
>>> On 12/17/2013 01:38 AM, Stuart Douglas wrote:
>>>> ----- Original Message -----
>>>>> From: "Anil Saldhana" <Anil.Saldhana at redhat.com>
>>>>> To: undertow-dev at 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.
>>> Unfortunately my unit tests run in junit. I cannot integrate the
>>> ServletExtension mechanism which is
>>> a wildfly based integration usecase. If PicketLink SAML SSO has to
>>> integrate with Undertow, the unit
>>> tests have to run in JUnit like we do with Tomcat and Jetty.
>>>
>>> Do you have goals for Undertow to be a standalone web container (like
>>> jetty) or it is just a web container
>>> usable in Wildfly?
>>>
>>>> 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
>>>>>>>



More information about the undertow-dev mailing list