Skip to content
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

The Twitter get email address rule does not work with Oauh2 #306

Open
KenEucker opened this issue Mar 20, 2022 · 1 comment
Open

The Twitter get email address rule does not work with Oauh2 #306

KenEucker opened this issue Mar 20, 2022 · 1 comment

Comments

@KenEucker
Copy link

I agree with the Auth0 Code of Conduct.

Description

The get email address from Twitter rule only works with Oauth 1.0 and Twitter v2 uses Oauth 2.0.

Reproduction

This code:
(from: https://github.com/auth0/rules/blob/master/src/rules/get-twitter-email.js#29)

...
const _ = require('lodash');
const request = require('request');
const oauth = require('oauth-sign');
const uuid = require('uuid');

const url = 'https://api.twitter.com/1.1/account/verify_credentials.json';
...

Produces this error:

Screen Shot 2022-03-20 at 8 45 32 AM

When using the new Twitter API and attempting to get email addresses with user logins, which you can log into without issue not using this rule:

Screen Shot 2022-03-20 at 8 46 04 AM

Environment

  • Version of this library used:
    vLatest from the "Enrich" rules from the Auth0 dashboard:

Screen Shot 2022-03-20 at 8 45 46 AM

  • Version of the platform or framework used, if applicable:
    IDK
  • Other relevant versions (language, server software, OS, browser):
    N/A
  • Other modules/plugins/libraries that might be involved:
    N/A

** Next Steps **

I am going to attempt to come up with an Oauth2 solution because I can't find anything on the internet that addresses this. I also searched this repository for mention of this issue but found nothing. I would welcome any collaborations or help or just feedback in general on this topic and if/when I get a working solution I can provide a PR for an additional javascript rule file for the Oauth2 flow.

@KenEucker
Copy link
Author

Followup on this: it seems that the Twitter API V2 does not support a way to retrieve the logged-in user's email address. I have posted a comment on a topic which talks about this issue:
https://twittercommunity.com/t/which-api-to-get-user-after-oauth2-authorization/162417/28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant