Hi @andypiper,
So, these are my answsers:
- you login to your mobile app using the Cordova / Twitter Kit functionality. That app will have its own Consumer Key and Token.
No, the App is using the twitter-connect-plugin 0.5.0. And it uses the same Consumer Key and Consumer Token as the backend server
- you’re returned three values - user x, with User Token and Secret for user x (which would be tied to the Consumer Key and Token used in the mobile app)
Yes. BTW, I’m sorry for the wrong name, twitterId is our variable name.
TwitterConnect.login(
(result) => {
this.loginUser({ twitterId: `${result.userId}`, twitterToken: result.token, twitterSecret: result.secret });
},
(result) => {
console.error('error authent Twitter : ', result);
this.setState({
confirmTwitterLoginErrorMessage: `Cannot log in to your Twitter account. Error: ${result}`,
showConfirmTwitterLoginError: true,
loading: false,
});
},
);
- you pass that JSON to the server side. There, you have a piece of Twitter4J code (that is using the same Consumer Key and Token used on the client side?).
Yes, it uses the same consumer key and token. It passes that JSON to the server side.
- you configure that code with the User Token and Secret for user x from the JSON passed over.
We use the token and secret provided by the App to make some checks.
- you grab an instance of the authenticated Twitter object from the factory, and then trace out the Twitter userid value from it.
Yes, we grab. The tracing it is just for debugging.
- the userid is a and not x …
Yes. That’s our observation but only with some accounts, not all.
- […] What login flow do you see?
I’m not sure to understand correctly that question. From my point of view, during the login or registration “flow”, it opens a page on the Twitter page for login (see the attachement), when clicking on the button “Connecter”, the App parses the provided response (see code above) and sends it to the server. With my personal account boeufseche, I don’t face this problem. I’ve created a professional one and face this issue.