whistler / ShibShib

Home Page:shibshib.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Twitter Login

whistler opened this issue · comments

I can do it if you are busy. Just gimme the keys.

Consumer keyeWjPI8AouBG2gsj94j2UNgConsumer secret
vegxmi6w52olZ2188GRhWUYu7CoyNLHQ3KsRszh5A8Request token URL
https://api.twitter.com/oauth/request_tokenAuthorize URL
https://api.twitter.com/oauth/authorizeAccess token URL
https://api.twitter.com/oauth/access_tokenCallback URLNone
On Tue, Apr 17, 2012 at 3:16 AM, Terfender <
reply@reply.github.com

wrote:

I can do it if you are busy. Just gimme the keys.


Reply to this email directly or view it on GitHub:
#5 (comment)

just figured out that twitter doesn't give out the email for authentication.
this is a must for us to complete user's registration, what to do?

We can probably override validates_presence_of email to a custom function
that checks if twitter id is there then we dont need email.

On Thu, Apr 19, 2012 at 9:37 AM, Terfender <
reply@reply.github.com

wrote:

just figured out that twitter doesn't give out the email for
authentication.
this is a must for us to complete user's registration, what to do?


Reply to this email directly or view it on GitHub:
#5 (comment)

half way though it, the problem is ( heartcombo/devise#1728 (comment) )
and validates_presence_of is implemented by omniauth gem, we don't have it in our user's model.

How about, just create a pseudo email. twitter_username@twitter.com?

yep, will do that.
btw, there is still a problem here. If the user edits his email from our website => logout => login via twitter again => leads to creating a new user.
Therefore, I suggest we rely on smth that the user can't edit, like twitter ID.
We will create another column in the user table and call it twitter_id. This will resolve twitter login functionality.

Another thing I wanna ask you about is: shouldn't the user_name be unique? or maybe the email?

Yeah, we definitely need to store twitter id in the database. Email is
already unique, dont know about user name.

On Mon, Apr 23, 2012 at 12:39 PM, Terfender <
reply@reply.github.com

wrote:

yep, will do that.
btw, there is still a problem here. If the user edits his email from our
website => logout => login via twitter again => leads to creating a new
user.
Therefore, I suggest we rely on smth that the user can't edit, like
twitter ID.
We will create another column in the user table and call it twitter_id.
This will resolve twitter login functionality.

Another thing I wanna ask you about is: shouldn't the user_name be unique?
or maybe the email?


Reply to this email directly or view it on GitHub:
#5 (comment)

Done and close for now. If you noticed smth weird, lemme know.

It should work now after you set call_back URL to http://shibshib.me/auth/twitter/callback