Skip to content
This repository has been archived by the owner on Feb 7, 2018. It is now read-only.

Login with google #27

Open
PVince81 opened this issue Jul 23, 2013 · 4 comments
Open

Login with google #27

PVince81 opened this issue Jul 23, 2013 · 4 comments
Assignees

Comments

@PVince81
Copy link
Owner

See branch "23-twitteroauth", maybe add it there.

There is a "oauth_provider" column in the DB that could use the value "google" instead of "twitter".

@ghost ghost assigned jdrudolph Jul 23, 2013
@jdrudolph
Copy link
Collaborator

I implemented a minimal working system for authentification in a different repository. Otherwise I would have had difficulties understanding the growing code base.
While it all works at http://dry-hamlet-3050.herokuapp.com/ i would like to make a better design for authentification and user management before merging.

There are still some things which are therefore to be implemented and tested

  • Unifiy data obtained from auth. requests by different providers
  • Create unwaste - user acoounts
  • Ensure that users stay authenticated
  • Use the session/cookie for more comfort

As I am still new to many concepts the following things are still a bit unclear:

  • How do sessions work and how to use them correctly
  • What security measures need to be implemented

@PVince81
Copy link
Owner Author

Adding link here for reference: https://github.com/jdrudolph/auth

@PVince81
Copy link
Owner Author

Ok, looks like passport is much better than the oauth library as it's much more high-level.
Will try to use that in the app instead.

PVince81 added a commit that referenced this issue Jul 29, 2013
- Added oauth fields in the "User" DB table.
- Added "passport" module to do the oauth authentication and callback in server.js
- Added oauth API to find or create a user after oauth authentication
- Added Google login #27
- Added Twitter login #23
@PVince81
Copy link
Owner Author

@jdrudolph I've added passport on this branch, using your code as inspiration: 23-passportauth

Please have a look. You can test it with your google app if you like, you need to add your settings into settings.json

The code should be generic enough to be able to login with anything.

The only issue left is that I don't know yet how to pre-init Angular JS with the correct user name.
One idea is to either render "index.html" as server-side template, with variables.
Or make Angular JS make an initial HTTP call to the server to ask what the current user is (which would be read from the session).

I'm not merging this yet because of that missing part (and needs more testing)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants