1

I am trying to implement a login system using the Android Studio LoginActivity template. On AppEngine, I try the two lines:

UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();

but the user is always null. How is it supposed to function and be implemented? I mean, does UserService class only work when integrating the Login with Google Accounts?

If yes, what is the best and smartest way for me to implement a customized login system?

Cris
  • 2,002
  • 4
  • 30
  • 51
  • what do u mean by customized? – eldjon Apr 08 '15 at 13:55
  • I mean not using the Google Accounts API – Cris Apr 08 '15 at 13:55
  • if i understand it correct u need to have a server setup for account verification. and use some web services to call them from the android site. – eldjon Apr 08 '15 at 13:57
  • 1
    UserService is not for that. Will only work when loading a webpage from a browser, not as an ajax call to appengine. The appengine docs explain how to implement such user validations with userService including a custom one not depending on google accounts – Zig Mandel Apr 08 '15 at 15:15
  • Could you provide a link or an example? Please – Cris Apr 08 '15 at 16:26

1 Answers1

1

Yes, UserService class only work when integrating the Login with Google Accounts (Gmail or Apps), and here is how you can handle that.

About the customized login system, there isn't a correct answer, you need to implement a system of API (login, register, reset password, ...) based on your needs. Surely you need a datastore entity which preserves the account information and the password for the login process.

Deviling Master
  • 3,033
  • 5
  • 34
  • 59