RESTful Authentication via spring with username/passwd and token
We are developing a mobile app. The server side is REST using Spring 3
MVC. I was trying to integrate the Spring Security with it to secure
resources. I went through lot of online material to get the information on
how to do it. I understand the architecture however when it comes to
implementing I am still confused. I referred a question asked here,
RESTful Authentication via Spring. And we are having the same
requirements. I understood the code however I am confused with the part
where first authenticate request comes in, at that time token will not be
present as the part of the header. So the same filter won't work. So I was
wondering how should I implement it. Please correct me if I am wrong. I
was thinking of implementing it as follows:
A separate filter that authenticates user using username password from the
request.
After authentication the filter sets the authentication info in the context.
And another filter that works with tokens for authentication for all API
URLS.
Is this the correct way to implement it? Any help is appreciated.
Regards, Meghana
No comments:
Post a Comment