opauth / twitter

Twitter strategy for Opauth
37 stars 52 forks source link

Twitter e-mail validation #2

Open alex-golubtsov opened 12 years ago

alex-golubtsov commented 12 years ago

Before send request to twitter, I ask user for his e-mail. Can I add an extra parameter(like scope in google strategy) to send to twitter e-mail and validate it. I expect to receive in response something like this: "email_verified" => 1(or 0)

Can I do this? Or how can I validate e-mail in other way?

Thanks.

uzyn commented 12 years ago

That's a good enhancement request.

As Twitter's OAuth contains no extra parameters for specifying state, the only way that can be done is by appending parameters to oauth_callback parameter.

Due to the parameter being handled internally by Opauth's TwitterStrategy, the extra parameters would be lost when Opauth does a callback to parent app.

I have marked this issue as enhancement and will be worked on to add state support.

Thanks @alex21 for your feedback and suggestion.

alex-golubtsov commented 12 years ago

Thank you for answer. Waiting for this enhancement:)

ceeram commented 11 years ago

From what i understand of twitter api, there is no way you can obtain or validate an email address by twitter. Can you provide a link where i can info on this subject?

uzyn commented 11 years ago

@ceeram I believe this story is asking for state support (or I believe can be implemented with state support – uzyn/opauth#21)

State support simply allows you to pass in a string and obtain a string back after all the callbacks and redirects.

ceeram commented 11 years ago

Twitter no longer allows variable get query parameters in callback urls, the url must match exactly the one you had set in the app settings. Opauth strategies can handle additional parameters like facebooks state parameter:

https://github.com/opauth/facebook/blob/wip/1.0/Strategy.php#L49

So it is very much dependent on the strategy provider

ceeram commented 11 years ago

source: https://groups.google.com/forum/#!topic/twitter-development-talk/dHYY98gCx1c