Hey. I just want to give everybody a heads up that we should read the documentation in order to understand whatās going on. So I decided to actually read the documentation and there it was. The solution was in the documentation.
On this URL https://developer.twitter.com/en/docs/basics/callback_url there is a sentence that says: "This means that if the callback_url parameter used with the oauth/request_token endpoint isnāt whitelisted, you will receive an error."
So, what I did was, I added a link from my application to the list of āCallback URLsā in my Twitter Application Settings and it worked.
Iām using a npm module Passport.js and there is an option for Twitter Strategy called callbackURL. I have added that URL to the list of Callback URLs in my Twitter Application Settings and it worked immediately.
So now in my āCallback URLsā i have:
And everything is working properly now. I guess that next time we should actually read the documentation before waiting for a solution from someone else.