Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Self-Destructing Message Android App Adding Users Using Parse.com Logging In

Edmunds Sulzanoks
Edmunds Sulzanoks
6,298 Points

How do I log in android users into my web app?

I was hoping that course "build-a-selfdestructing-message-android-app/adding-users-using-parsecom/logging-in" will tell me all I need to know. All I'd need to do is replace parse backend with my web app + adapt my web app to supply info parse does. But the problem is this course relies on parse onbjects and their built in methods too much -- I'm not learning anything here.

Taking data presistance course now. I'll think of my own way, but I'm sure it'll be the "inefficient" in the end.

UPDATE So here's the solution I came up with.

  1. to log user in into laravel web app, android app will have to provide:
    • android app api key;
    • email adress;
    • password;
  2. web app will send JSON response with:
    • nickname
    • user id
    • access token ( md5(user's_email + password hash + salt) )
  3. android app saves supplied user info in SharedPreferences
  4. when making requests that require user authorisation, android app will read SharedPreferences to provide:
    • user id
    • access token
  5. web app will
    • get user by id
    • calculate md5 and compare it with supplied token

Is this the way to do it?