On Tue, Jul 17, 2012 at 2:01 PM, bhorvat <horvat.z.bo...@gmail.com> wrote: > I have 2 problems. The first one is how can I look at the url that is being > accessed. The reason for that is because to rest service it will be able to > access from subdomains like such > example1.webapp.com/rest/ > example2.webapp.com/rest/ > So I need to detect what is the url so that I could extract the first part > of the url. In the tapestry page I would just @Inject the Request object and > get all I need from this. Is it possible to do something similar here? Or of > someone has some other idea please share.
Have you tried it? You can just @Inject the Request into your service. > The second problem is how can I integrate the security with this. I am using > tynamo (again :)) security module for my application security. Ideal I would > just like to annotate the methods with securty annotation like I do in > tapestry pages, but my problem is how can I share the the user. > So in tapestry page I have a login where the user enter his > username/password and then I would give that to my User Realm, after that > all I have to do is use the annotations. How can I achieve this behavior? Or > is there a better way to do this? Do you mean you want let users authenticate using the login page and use your rest services only with a valid session? (In which case they are not really restful but...) In that case, that should just work and you can use annotations to secure your rest services operations same way as you secure your page operations. If you are asking how to authenticate against a completely stateless rest service, configure basic authentication, disable sessions and send the credentials with every client request. Kalle --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org