Can't retrieve oauth_verifier



Hello, i implemented the Sign in with twitter as this tutorial shows.
I fail to get all the parameters i need as soon as the callback is made on step 2.

This is step 1 code on my server:

if (!req.body.oauth_token || !req.body.oauth_verifier) {
    let requestTokenOauth = {
        consumer_key: self.twitter.consumer_key,
        consumer_secret: self.twitter.consumer_secret,
        callback: req.body.redirectUri + '?contractId=' + contractId
    //Step 1 - send OAuth token back to authorization screen{ url: requestTokenUrl, oauth: requestTokenOauth }, function(err, response, body) {
        let oauthToken = QueryString.parse(body);
        //Step 2. Send OAuth token back to open the authorization screen.

That contractId is there because it is useful for my app. I dont think it is interfering with anything.

This is my code to open the popup:

		return'/api/twitter/authenticate', JSON.stringify(defaults), {}).subscribe((value: any) => {
			let parsedBody = JSON.parse(value._body);
			let qs = '?oauth_token=' + parsedBody.oauth_token;'' + qs, 'Twitter Login', 'width=500,height=550');

After the user interaction witht he popup i get redirected to my res.body.redirectUri as expected but i do not receive the oauth_token and oauth_verifier as expected.


So body does not have a value like this? What does it have? What is the status code of the response?



I tried to capture the http packages on my server with wireshark and i found out that i was receiving 2 requests as soon as the popup is closed.

One to http://localhost:4200/#/account?oauth_token=xxx&oauth_verifier=xxx
And another to http://localhost:4200/#/account?contractId=xxxx

Is this a normal behaviour?


i receive those as an answer to my post. My problem is with the popup callback.