martsve / mkm_api

MagicCardMarket API accesser (cmd and js)
GNU General Public License v2.0
10 stars 0 forks source link

Error 401: Unauthorized #1

Closed megaslothy closed 8 years ago

megaslothy commented 8 years ago

I have configured App Token, App Secret, Access Token and Access Token Secret in tokens.txt file. My app is Dedicated. I always get the error 401: Unauthorized. Is it necessary to set up something else?

Thanks

martsve commented 8 years ago

There shouldn't be other set up necessary. Some guesses to what might be wrong:

I updated the code, so try to re-download it. It now tells you what tokens it tried to use when you receive a 401 error.

megaslothy commented 8 years ago

I downloaded the app again and have checked (and typed) the token information but still getting the same error. I can't see the message with error tokens also. The tokens.txt file that I use is the one generated when executing mkm.exe without tokens.txt.

martsve commented 8 years ago

Did you use this link to download the new version?

https://github.com/martsve/mkm_api/archive/master.zip

Make sure you overwrite the old one. I just tried downloading it, and exectuing with a mock-file and get this display:

  D:\>mkm get account
  Error: The remote server returned an error: (401) Unauthorized.
  App token = 'a'
  App secret = 'b'
  Access token = 'c'
  Access token secret = 'd'
megaslothy commented 8 years ago

I used the correct link and re-downloaded again from your message. Still getting the same error and don't see the error tokens.

C:\mkm_api-master>dir
 El volumen de la unidad C no tiene etiqueta.
 El número de serie del volumen es: 7464-2AD4

 Directorio de C:\mkm_api-master

26/10/2015  23:16    <DIR>          .
26/10/2015  23:16    <DIR>          ..
26/10/2015  08:49             2.518 .gitattributes
26/10/2015  08:49             3.138 .gitignore
26/10/2015  23:16    <DIR>          examples
26/10/2015  08:49            18.027 LICENSE
26/10/2015  08:49            11.776 mkm.exe
26/10/2015  08:49             1.466 README.md
26/10/2015  23:16    <DIR>          source
26/10/2015  23:13               104 tokens.txt
               6 archivos         37.029 bytes
               4 dirs  18.802.454.528 bytes libres

C:\mkm_api-master>mkm get account
Error: Error en el servidor remoto: (401) No autorizado.

C:\mkm_api-master>

And the tokens.txt:

URL=https://www.mkmapi.eu/ws/v1.1/
App token=a
App secret=b
Access token=c
Access token secret=d

No idea what it's happening

martsve commented 8 years ago

Allright, the language made it skip the error.. I corrected it to check for error code, and it should now display the token used when it fails.

megaslothy commented 8 years ago

Now It displays the token used but it is exactly the token information I have in my MKM account page and I still have the 401 Error.

martsve commented 8 years ago

Ok..

megaslothy commented 8 years ago

Worked!

The app is Dedicated and I renewed tokens before so it seems to be some problem with my local language.

Thanks!!