Problems with auth :(

Want to help out? Need help accessing the AniDB API? This is the place to ask questions.

Moderator: AniDB

Locked
Finalspace
Posts: 6
Joined: Fri Feb 04, 2005 10:27 am
Contact:

Problems with auth :(

Post by Finalspace »

Hi there,

i am readed the udp-api specs and tryd to create a simple client.
I use delphi with Indy Components which comes with a simple udp solution.
But thats not the point:

The first thing you must do is Authorize by anidb server.
I do this with:

Code: Select all

  // First send login to anidb server
  Username := edtUsername.Text;
  Pass := edtPassword.Text;
  APIVersion := '2';
  Clientname := 'wakeauanime';
  ClientVersion := '1';
  ClientTag := 'wakeauanime';
  S := Format('AUTH user=%s&pass=%s&protover=%s&client=%s&clientver=%s&tag=%s',[Username, Pass, APIVersion, Clientname, ClientVersion, ClientTag]);

  // Debug line
  memLog.Lines.Add('Send: ' + S);

  // Send the data with udp
  udpClient.Send(S);

  // Wait a little
  Sleep(100);

  // Get the received message
  S := udpClient.ReceiveString;

  // Debug line
  memLog.Lines.Add('AniDB: ' + S);
Always i become a receive like this: "wakeauanime 505 ILLEGAL INPUT OR ACCESS DENIED".

my auth string is like this: "AUTH user=myusername&pass=mypassword&protover=2&client=wakeauanime&clientver=1&tag=wakeauanime"

I have no idea what is wrong :(

plz help,
thx final
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

did you ensure that the username is all lower case?

BYe!
EXP
Finalspace
Posts: 6
Joined: Fri Feb 04, 2005 10:27 am
Contact:

Post by Finalspace »

Thx, das wars :)
su8zer0
Posts: 20
Joined: Sun May 15, 2005 1:22 pm
Location: Poland
Contact:

Post by su8zer0 »

I'have similiar problem like Finalspace, but in my case I'm just not getting any response from the server. No matter which command I send (PING, AUTH...). WebAOM is working fine, so the Api isn't down. I'm stuck with it for two days and have no idea what's wrong (probably some stupid mistake on my side :) ). Anyone has ny ideas ?
epoximator
AniDB Staff
Posts: 379
Joined: Sun Nov 07, 2004 11:05 am

Post by epoximator »

are you using api.anidb.info? (not anidb.ath.cx)

you have to give some more info if you want help. some code would be helpful
su8zer0
Posts: 20
Joined: Sun May 15, 2005 1:22 pm
Location: Poland
Contact:

Post by su8zer0 »

Yes, I'm using api.anidb.info, port 9000.
The code is rather simple ATM :)

Code: Select all

tmp:='AUTH user=su8zer0&pass=x&protover=2&client=notif&clientver=1&tag=pknotif';
UDPC.Send(tmp);  //TIdUDPClient Component (Indy 10)
Sleep(500);
tmp:=UDPC.ReceiveString(ip,port);
output.Lines.add(ip+IntToStr(port)+tmp);
It gets to ReceiveString and stops in there, waiting for response which never comes. I tried with other components (TUDPSocket) and even with raw sockets (without any component), but there was no change.

Oh, and one more little question: When i telnet to api.anidb.info:9000 i connect to TCP api or UDP api?
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post by exp »

telnet will connect you to the TCP api.
to get easy debugging access to the UDP api i would suggest a tool called "netcat", the feeling is a bit like telnet, but it has a lot more functions.

about your code, make sure that you are using the same ip&port for sending and receiving.
might be a good idea to post some more code examples here.

BYe!
EXP
su8zer0
Posts: 20
Joined: Sun May 15, 2005 1:22 pm
Location: Poland
Contact:

Post by su8zer0 »

OK, i've solved it. Basically the code was good, the problem was with the component. Active property should be set to False, meaning that the component can send data but will not listen to incoming connections. Little strange IMHO - component to work must be turn off :o

By the way, thanks exp, that netcat thingy will be useful :wink:
Locked