Page 1 of 1

Problems with auth :(

Posted: Fri Feb 04, 2005 12:03 pm
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

Posted: Fri Feb 04, 2005 6:26 pm
by exp
did you ensure that the username is all lower case?

BYe!
EXP

Posted: Thu Feb 10, 2005 10:42 am
by Finalspace
Thx, das wars :)

Posted: Sun Nov 06, 2005 10:34 am
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 ?

Posted: Sun Nov 06, 2005 10:49 am
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

Posted: Sun Nov 06, 2005 11:20 am
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?

Posted: Sun Nov 06, 2005 4:32 pm
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

Posted: Sun Nov 06, 2005 8:52 pm
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: