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

Instagram auth: Error in the token Function: undefined #423

Closed
alamboley opened this issue Jun 21, 2018 · 2 comments
Closed

Instagram auth: Error in the token Function: undefined #423

alamboley opened this issue Jun 21, 2018 · 2 comments

Comments

@alamboley
Copy link
Contributor

alamboley commented Jun 21, 2018

Hello, I tried to clone the instagram auth exemple, but I've this issue when I add my instagram credentials: Error in the token Function: undefined.

My app is in sandbox, and my user added.

exports.token = functions.https.onRequest((req, res) => {
  const oauth2 = instagramOAuth2Client();

  try {
    return cookieParser()(req, res, () => {
      console.log('Received verification state:', req.cookies.state);
      console.log('Received state:', req.query.state);
      if (!req.cookies.state) {
        throw new Error('State cookie not set or expired. Maybe you took too long to authorize. Please try again.');
      } else if (req.cookies.state !== req.query.state) {
        throw new Error('State validation failed');
      }
      console.log('Received auth code:', req.query.code);
      oauth2.authorizationCode.getToken({
        code: req.query.code,
        redirect_uri: OAUTH_REDIRECT_URI,
      });
    }).then((results) => {
      console.log('Auth code exchange result received:', results);

Thanks to Firebase cloud functions diary, I see the Received auth code log, but nothing after that. Sounds like the oauth2.authorizationCode.getToken fails.

What did I miss?

Thanks for the help!

@alamboley
Copy link
Contributor Author

Up @nicolasgarnier ?

alamboley added a commit to alamboley/functions-samples that referenced this issue Jun 25, 2018
nicolasgarnier added a commit that referenced this issue Jun 25, 2018
return a correct error not undefined like in #423
@samtstern
Copy link
Contributor

I believe this was fixed by #424

OfJunker added a commit to OfJunker/functions-samples that referenced this issue Dec 29, 2020
update spotify-auth to show full error instead of just undefined like in PR firebase#423
OfJunker added a commit to OfJunker/functions-samples that referenced this issue Dec 29, 2020
update spotify auth to give full error instead of just undefined, same as in PR firebase#423
samtstern pushed a commit that referenced this issue Dec 30, 2020
update spotify auth to give full error instead of just undefined, same as in PR #423
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

2 participants