-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authentication #10
Comments
The second part of authentication which is attaching a second Gmail id seems a bit tricky. |
I didn't get the pipeline thing completely, mostly because I'm not very well-versed with social auth/oauth stuff. But can't we maintain a mapping of both the email IDs in our database, and use this mapping to show same information to user whether he/she logs in from either of the email addresses? |
@chirag200666 What we discussed over phone seemed quite possible to me. Let me have a crack at it over this weekend. |
python-social-auth has a set of tasks to be done in a sequence e.g. forward for authentication -> get name, email etc. -> create account -> login. They call this sequence pipeline. At the end it attaches the google,fb account to a 'User' object of Django. The problem is that in the pipeline we have mentioned to allow only IITH email ids, so a person cannot attach his/her personal google account, so if we modify the behaviour to accept other email id's during the email_allowed part of pipeline, then during the create_user part, after creation we will have to store the mapping of the two accounts, then in the last step we can specify to login with the original/primary 'User' account. Another hacky solution is possible during registration. When the user is filling his/her personal email, we can create a 'User' object with that email and store the mapping, now whenever the person tries to login with that gmail id, python-scoial-auth will map that account with the 'User' object we created, then we can forward him to his mapped account. |
Me and @ajayaa discussed auth in some detail. so I'm writing it down here, so that the development happens 'out in the open', and we gather important feedback.
We will use GMail OAuth for authentication. A user will be able to use only his IITH email ID to log in. We'll need to parse the email ID being used to log in into the website, and only allow the 'valid' email id. One special case is 2008 batch, who don't have email IDs by their roll numbers but by their names. But that's easy to solve too. We'll need to maintain a list of those IDs in the database and check against that.
Once this functionality is done, the next step should be to allow logging in using the person's 'personal' GMail ID and keep an association of this ID and the original IITH GMail email ID. This will allow convenience -- the user will not have to log in using IITH GMail email ID all the time. So potentially, one will need to log in via his IITH GMail email ID only once, and from later on he can use his personal GMail email ID.
The text was updated successfully, but these errors were encountered: