I’m using GWT and RequestFactory on a new project that needs authentication.
Where would be the best place to add the login and logout functions ? in a UserRequestContext ?
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use servlet filter.
I split RequestFactory calls into two streams – one for unauthenticated calls and another one for authenticated ones. Here is piece of my
web.xml.Then I created servlet filter which looks like this:
As you can see I set
loginhttp-header with URL to auth webpage.In the client code I intercept it by implementing my own DefaultRequestTransport that looks ike this:
Fired event is handled in the client code that navigates browser to login URL.
That’s it.