Hi Kalle Korhonen-2 thx for reply

I have tired to just inject the response object but I got some strange null
pointer (the actual object is not null but something in side of it I guess
it is ). Here is the exception 

 java.lang.NullPointerException: Unable to delegate method invocation to
property 'request' of <Proxy for
RequestGlobals(org.apache.tapestry5.services.RequestGlobals)>, because
the property is null.</pre></p>
Caused by:
<pre>org.jboss.resteasy.spi.UnhandledException:
java.lang.NullPointerException: Unable to delegate method invocation to
property 'request' of &lt;Proxy for
RequestGlobals(org.apache.tapestry5.services.RequestGlobals)&gt;, because
the property is null.

I agree that they wont really be restful but I need to have some sort of
security layer so that not everyone can access them. I have tried to reuse
the login logic that works for normal pages 

    @Inject
    private SecurityService securityService;

 UsernamePasswordToken token = new UsernamePasswordToken(username, password,  
getStudioFromURL().getDomain());

        Subject currentUser = securityService.getSubject();
        try {
            currentUser.login(token);

            return (User) SecurityUtils.getSubject().getPrincipal();

        } catch (UnknownAccountException e) {
        } catch (IncorrectCredentialsException e) {
        } catch (LockedAccountException e) {
        } catch (AuthenticationException e) {
        }

and this works (now, when I tried it a 30 min ago it throw an exception that
security manager is not initialize in a proper way or something like that).
However when I do this. What should I get back to the user? A coockie? And
how should he send it back? I know that rest has some option to retrieve
cookie ( @CookieParam) can I use that on my end here?

Once again tnx for help 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-Tynamo-Rest-and-security-integration-questions-tp5714525p5714528.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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

Reply via email to