alexandrugavril / CamiAndroidApp

0 stars 0 forks source link

Login Functionality #9

Closed alexandrugavril closed 6 years ago

alexandrugavril commented 6 years ago

The application should Post the login information to the CAMI Endpoint along with the Application registration ID for notifications.

asorici commented 6 years ago

To make things easy at login (i.e. perform no prior user registration from the mobile client side), I propose the following set of steps:

  1. User logs in using a username + password combination

    • username is the same as the username or email on the serverside (see JSON output of following call: http://139.59.181.210:8008/api/v1/user/2/

    • password is checked "only client side" :-) and is hardcoded to the word "imac"

    • if the filter request (e.g. http://139.59.181.210:8008/api/v1/user/?username= returns a list with a single element, then the login is considered successful. From the returned JSON message the id field is retrieved.

    • the mobile client performs a post request containing the user uri, the registration id and the notification type ("GCM")

      • if the post returns a 201, it means the new registration id has been added
      • if it returns a 4xx error, it means the registration id has not changed from the last login time

Note

For documentation on CAMI Cloud endpoints see: http://139.59.181.210:8008/api/documentation/

alexandrugavril commented 6 years ago

avaliable users: camidemo / camicare

asorici commented 6 years ago

I will consider this done. There was the additional issue of keeping the logged in state when moving the app in the background. I know that to be solved as well, but if it is not I will open a separate issue.