x1ddos / simpleauth

Simple authentication for Python on Google App Engine supporting OAuth 2.0, OAuth 1.0(a) and OpenID

Home Page:https://simpleauth.appspot.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example app Possible Enhancement

conradwt opened this issue · comments

@crhym3 I have been playing with the SimpleAuth for a few days and I noticed that it uses a single User object for an individual user and links the additional social networks to this logged in user. I'm thinking about adding some functionality where I would like the first logged in account to be used when displaying the profile information instead of switching profiles every time user links an account. Thus, do you see this as a good addition to the SimpleAuth module?

commented

Hey @conradwt I assume you're talking about the example app. I did it on purpose to keep things simple and for the demo effect :)

In fact, in a real production app I wouldn't probably change profile picture and link on every user login. Additionally, in a production app I would probably fetch their profile photo in a Task to make a local copy (in case original provider changes URL) and then "refresh" it from time to time.

Anyway, I think what you're saying is achievable by commenting line 162: https://github.com/crhym3/simpleauth/blob/master/example/handlers.py#L162

Also, check other comments starting from lin 142: https://github.com/crhym3/simpleauth/blob/master/example/handlers.py#L142

Actually, this got me thinking that probably not every single sign in needs fetching user info in the first place. I could spare 1 urlfetch call. But this is a separate thing. I'll create another issue.