About to implement a solution which allows a user to login/register from a JSP page OR from an Android client. We will be using REST exclusively.
What I plan on doing is as follows.
User Registers, causing a user token (name/pwd) to be POSTED to my REST service. This will be persisted and an Auth token created for this user and the username,pwd and Auth token will all be persisted.
The Auth token is then returned to the user and sent back with any further REST calls.
The token will expire after say 2 weeks.
On further logins a user/pwd will be sent to the REST service and checked against the persisted version.
Is this a good way to go about authentication ? Is there any frameworks that handle this sort of functionality as it is common to almost all client server apps?