-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Get user email #67
Comments
Have you solved it? I´m waiting for approval so i cannot test, but it says in Twitter docs that you´ll have to forget old tokens for the extra permission to appear. |
Not solved yet. I just removed the twitter authentication from the site, seeing that it didn't work as it supposed to, waiting to have some time to do more testing. So you should regenerate the token after the permission was granted? That's all? Tell me if it worked for you after you get the approval please. Thanks! |
This exists in PR #61 , hopefully @jaredhanson will have some time to look into it. |
+1 |
You can.. but you have to add a userProfileURL in the authorization strategy.. This is my strategy: // Twitter OAUTH Strategy
Auth.passport.use(new TwitterStrategy({
consumerKey: config.get("authentication.twitter.consumerKey"),
consumerSecret: config.get("authentication.twitter.consumerSecret"),
userProfileURL: "https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true",
callbackURL: config.get("authentication.twitter.callbackURL")
},
function(token, tokenSecret, profile, done) {
Login.findOrCreateUser(profile,function(err,user) {
done(err,user);
});
}
));
´´´ |
That URL doesn't work for me. Looking at the source code it seems like
is being appended to the URL which screws up the request if there is already a "?include_email=true" query string. Is there a particular reason why the "account/verify_credentials" API endpoint isn't being used by this request? Because that would eliminate the need for adding the user ID as a query string... |
Yeah sorry. I commented that out of the file a long time ago and didn´t remember . On Sun, Dec 20, 2015 at 8:58 AM, Taylor Stevens [email protected]
|
Has this been resolved? I keep getting 500 "Could not authenticate you." error when trying to get the user profile with email, using @nachojimenez's answer above. Also using a whitelisted app, and have followed all of the steps (add TOS and Privacy Policy page links, check "Additional Permissions" box, etc.) |
Did you remove the automatic query string addition in the userProfile function? Also did you create new API keys and secrets after gaining permission and checking the box? |
+1 |
+1 Thought #61 addressed this, but upon trying |
Is your application whitelisted by Twitter for it? |
I can confirm by adding |
Wish Twitter would just use |
@MichaelArnoldOwens no, but you do have to get a new token for each user as it says it "only applies to new logins". @tambling I'm with ya! so annoying.... however, it does work with userProfileURL, if you've been granted email permissions, which is better than nothing! IT ALSO works by using here's what I'm using:
To get whitelisted, use this URL: https://support.twitter.com/forms/platform, select "I need access to special permissions", then enter "Email" into "Permissions Requested" |
@boycce's answer worked for me as well. Thanks |
I requested whitelisting by going to https://support.twitter.com/forms/platform and got this email in reply:
|
can confirm: by adding the email permissions to my app and regenerating the consumer key and secret AND by adding this special url to my strategy like this:
then it just starts working like any other oauth2 passport strategy (i've implemented so far) by giving you a |
@rvetere: closing |
@davidwieler's answer is great! Here are updated steps to add email permissions to a Twitter App in 2019:
|
Thanks to @rvetere. Request email address from users option should be checked. and you have to Regenerate the Tokens to get the email value in response. |
@davidwieler |
You need to add ` |
I`ve seen that in order for Twitter to let you access user email, you have to ask them for special permission to do so.
I've received the permission, then enabled it under "Additional permissions" on my Twitter app management, but still can't retrieve the email. Is this a problem with this library or is it with Twitter?
The text was updated successfully, but these errors were encountered: