Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google app engine - login with Google, Facebook

I would like the users of my application, hosted in Google app engine, login the same way I do in StackExchange, using my Google account or Facebook account.

I have some questions on this:

  1. I would like to see some tutorials on basic login only
  2. I would like to see some tutorial(s) on social login (Google, Facebook, etc.. )
like image 688
Mc- Avatar asked Jun 04 '11 15:06

Mc-


People also ask

Is Facebook an identity provider?

To use a Facebook account as an identity provider, you need to create an application in the Facebook developers console. If you don't already have a Facebook account, you can sign up at https://www.facebook.com/.


2 Answers

You can use the Federated login API provided by Google to help users connect using Open ID providers (like Google, Windows Live, Yahoo, etc.).

Check out these links:

like image 150
Remy Vanherweghem Avatar answered Sep 17 '22 17:09

Remy Vanherweghem


A login system is rather straightforward. Basically it is something like this:

User wants to access something that is restricted and needs a valid Account.

You check if he is logged in.

If not, you prompt the user to either create an account, or login.

If he has an account he will enter his username/password combination (preferably over SSL). You then check if the combination is valid and set his state to logged in. The best way to do this would be a cookie plus a session variable, but it depends on what you want to use.

If the user has not an account you can give him the choice to create one. Here you let him fill out everything you need, Name, username, password et cetera. And be sure to send it all over SSL again.

From there he then should be able to login successfully.

If you want some code this seems to be complete: http://www.wikihow.com/Create-a-Basic-Login-Script-in-PHP




For facebook, it is a bit different as Facebook requires the user to be logged in and prompts on it's own if he is not. To see how to use the Facebook API you can go here: http://developers.facebook.com/docs/guides/web/

The Authentication part is the one you should look at.

like image 37
Neikos Avatar answered Sep 17 '22 17:09

Neikos