I know it’s not the way it’s meant to be and it’s totally wrong, but orders are orders, I need to do the following:
The user access the servlet with the accesskey on the parameters, like this:
http://myhost/my_app/servlet?accesskey=XXXXX
The servlet then gets the key and authenticate the user on seam with it, is it possible? I couldn’t manage to do it so far
From your question it is not clear if you are required to create a custom servlet or you just need to make login based on a request parameter. The main difference is that a custom servlet is not intercepted by Seam and you cannot use components unless you manually start a seam lifecycle (as noted by Trind, you need to use
LifeCycle.beginCall()andLifeCycle.endCall()to be able to use Seam components when calling from outsideSeamFilter). Other than that, the two solutions work similarly.Create a component that will handle authentication:
Now create a login page descriptor that will handle login via the parameter (say
externalLogin.page.xml, you don’t need to create an.xhtmlpage for this):Now to perform login you can use that page, like so:
If you need to use a custom servlet (very unlikely, but nevertheless), the above component does not change, just call it from within the servlet like this: