Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Authorize Error: unconfirmed callback (Twitter) #51

Closed
aprout opened this issue Feb 7, 2017 · 12 comments
Closed

Authorize Error: unconfirmed callback (Twitter) #51

aprout opened this issue Feb 7, 2017 · 12 comments

Comments

@aprout
Copy link

aprout commented Feb 7, 2017

  1. Using twitter auth, I keep receiving an 'authorize error: unconfirmed callback' error. I'm likely doing something incorrectly with the app credentials or the url scheme, but I can't figure out what it is. Do you have any examples containing the specifics of the app registration details on twitter and with the corresponding callback used?

  2. I'm able to get google auth working using the code from the example, but when I attempt incorporate it into my larger app, the promise never resolves when returning to my app from the google auth page, thus no data. Any ideas?

Edit: Experiencing the same problem with facebook as google .

Thanks!

@adamjmcgrath
Copy link
Owner

That error message is pretty rubbish. If you log out resp in https://github.com/adamjmcgrath/react-native-simple-auth/blob/master/lib/utils/oauth1.js#L25 you'll get better info

My guess is that the larger app is missing some of the deep link setup stuff, have another look at the install steps https://github.com/adamjmcgrath/react-native-simple-auth#install

@aprout
Copy link
Author

aprout commented Feb 9, 2017

Thanks! Got everything sorted.
Regarding Twitter auth, do you know of a way to enable the request to include the params {include_email=true}? I tried adding it in a few places, but received errors. Thanks again.

@adamjmcgrath
Copy link
Owner

No worries. It looks like you would add it to the verify credentials url: https://github.com/adamjmcgrath/react-native-simple-auth/blob/master/lib/providers/twitter.js#L26

@aprout
Copy link
Author

aprout commented Feb 10, 2017

Yeah, I tried adding it to the verify credentials url first, as well as passing it in with the params object, but the attempt is always met with a {code: 32, message: "Could not authenticate you."} error. I suspect the include_email parameter needs to be added during the signature generation, but I can't quite figure it out. Thanks again.

@adamjmcgrath
Copy link
Owner

Ah yep, you'd need to pass it in to the signature generator as well:

const VERIFY_CREDENTIALS = 'https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true';

export const identify = curry(
  (request, { appId, appSecret, oauth_token, oauth_token_secret }) => pipeP(
    partial(request, [VERIFY_CREDENTIALS, {
      headers: getHeaders(VERIFY_CREDENTIALS, { include_email: true }, {}, appId, appSecret, 'GET', oauth_token, oauth_token_secret), // eslint-disable-line max-len
    }, {}]),
    invoker(0, 'json'),
    set(lensProp('user'), __, {}),
    set(lensProp('credentials'), { oauth_token, oauth_token_secret }),
  )(),
);

These custom provider options should be added to the library really - see my comment about it here: #53 (comment)

@aprout
Copy link
Author

aprout commented Feb 28, 2017

Yeah, I'm not sure actually works, passing in the parameter that way. I still receive a could not "Could not authenticate you." error. If I make any progress, I'll make a pr.

@atarsha
Copy link

atarsha commented Apr 21, 2017

I am in the same boat as @aprout. Since my backend database uses the email address as their login credentials, being unable to retrieve that from Twitter renders twitter login completely useless, as I cannot tie it to an existing account.

I tried @adamjmcgrath's suggestion above, and like @aprout, I got the "Could not authenticate you" error, even with the parameter added to the signature as both a string or boolean true.

I am, unfortunately, at a loss at how to proceed here. Give up? Any ideas would be very welcome.

@Asim13se
Copy link

Asim13se commented Nov 10, 2017

@atarsha @aprout I solved the issue, pass VERIFY_CREDENTIALS_BASE to getHeaders instead of
VERIFY_CREDENTIALS

const VERIFY_CREDENTIALS_BASE = 'https://api.twitter.com/1.1/account/verify_credentials.json';
const VERIFY_CREDENTIALS = 'https://api.twitter.com/1.1/account/verify_credentials.json?include_email=true';

export const identify = curry(
  (request, { appId, appSecret, oauth_token, oauth_token_secret }) => pipeP(
    partial(request, [VERIFY_CREDENTIALS, {
      headers: getHeaders(VERIFY_CREDENTIALS_BASE, { include_email: true }, {}, appId, appSecret, 'GET', oauth_token, oauth_token_secret), // eslint-disable-line max-len
    }, {}]),
    invoker(0, 'json'),
    set(lensProp('user'), __, {}),
    set(lensProp('credentials'), { oauth_token, oauth_token_secret }),
  )(),
);

@franj0
Copy link

franj0 commented Feb 1, 2018

I still not getting email...
Request is same as before modified twitter.js in node_modules...
image

UPDATE: sry, it's working, i forgot check Request email addresses from users in app permissions

Thank you

@leventyildirim61
Copy link

leventyildirim61 commented Jun 26, 2018

Hello

I have a problem for twitter login. The error is

Error: Unconfirmed callback
at assert (oauth1.js:20)
at verifyCallback (oauth1.js:25)
at tap (ramda.js:4139)
at ramda.js:466
at f1 (ramda.js:446)
at tryCallOne (core.js:37)
at core.js:123
at JSTimers.js:301
at _callTimer (JSTimers.js:154)
at _callImmediatesPass (JSTimers.js:202)

Any idea for this ?

@thorlando
Copy link

Hello

I have a problem for twitter login. The error is

Error: Unconfirmed callback
at assert (oauth1.js:20)
at verifyCallback (oauth1.js:25)
at tap (ramda.js:4139)
at ramda.js:466
at f1 (ramda.js:446)
at tryCallOne (core.js:37)
at core.js:123
at JSTimers.js:301
at _callTimer (JSTimers.js:154)
at _callImmediatesPass (JSTimers.js:202)

Any idea for this ?

In my particular case, I didn't have the scheme in the Twitter dev console set correctly. Attempting to add "appname://authorize" as a callback URL failed, but adding just "appname://" worked for me. Make sure you then set your callback on the React Native code to "appname://authorize" though.

thorlando added a commit to thorlando/react-native-simple-auth that referenced this issue Oct 26, 2018
…t when I get a chance, but right now I need this quick.
@rodrigoreis22
Copy link

good catch @realmadrid2727 ! it worked for me.

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

No branches or pull requests

8 participants