-
Notifications
You must be signed in to change notification settings - Fork 218
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
Unable to authenticate at all #1183
Comments
When I use the example in the documentation for V2 sample stream, I get an error response like this:
What is Error Code -1 ? I tried searching for it but I do not receive much information about it? |
Same issue |
@StyptoAlgo I eventually figured it out. There are different "client" types but they are not mentioned in the beginning of the examples. You have to dig and dig and find the TwitterClient wiki page. I ended up using a variation of the "appClient", although it's not the same in the example on the wiki! I eventually noticed in some examples throughout the wiki, that the "TwitterClient" is constructed differently. There are also overloaded methods for the "TwitterCredientals" method. Here is what I ended up using (in .NET 6, so it's a little bit different than regular "Startup.cs" files):
I store the consumer key, secret and bearer token in my appSettings.json configuration file. And the "TwitterCredentials" uses the overload method that needs the bearer token. Now in my service layer, I can access it easily like so:
and then finally, viola!
I hope this helps put you in the right direction. I really pulled my hair out a few days on this... |
Hello, I am trying to run the example from the "Getting Started" instructions., using this code example:
I am unable to authenticate no matter what I try. I have tried my keys and tokens. I have also regenerated my keys and tokens, and I still get the same error message, which is:
I have also tried the different overloads of the TwitterCredentials class, like so:
but I get a different error message:
I am unsure what I am missing or doing wrong. I copied and pasted my keys directly from twitter. Also, I checked my Twitter developer account and verified I have "Essential" permissions, but not "Elevated" permissions. Do I need "Elevated" to be setup?? I wouldn't think so....
I have been able to use Curl and PowerShell to hit the "sample stream" example straight from Twitter's documentation, and that does work, so I know my bearer token is valid.
Any help is greatly appreciated, as I would ultimately like to stream the API for the "sample stream V2" example.
The text was updated successfully, but these errors were encountered: