Hello everyone!
I tried to user curl to obtain a auth token from myserver,
and then I tried to get the client login url with that token.
but i got following response:
BillydeMacBook-Pro:~ Billy$ curl -H 'Authorization: Token 369f32fa968761ff4492e45d7fe38cd6a7ea1dd7' https://seafile.babustudio.net/api2/client-login/ {"detail":"Method \"GET\" not allowed."}
According to the manual, the only error expected is 403 invalid token, but i got this, 405 method not allowed.
Does anyone know how to deal with this? I will appreciate that if you can help me out.
For me the response for the same request is invalid token (I’ve queried your server).
curl -H 'Authorization: Token 369f32fa968761ff4492e45d7fe38cd6a7ea1dd7' https://seafile.babustudio.net/api2/client-login/
{"detail":"Invalid token"}
I am sorry that I did not provide the correct token for safety considerations. Here is the right token:{"token":"469f32fa968761ff4492e45d7fe38cd6a7ea1dd7"} Please help me solve this problem, I really appreciate that you replied to me!
Make sure to delete the token if you haven’t created it for some test account.
With the working token I get the same result as you.
curl -H 'Authorization: Token 469f32fa968761ff4492e45d7fe38cd6a7ea1dd7' -X GET https://seafile.babustudio.net/api2/client-login/
{"detail":"Method \"GET\" not allowed."}
Without token it says
~ curl -X GET https://seafile.babustudio.net/api2/client-login/
{"detail":"Authentication credentials were not provided."}⏎
Only with a working token it says GET not allowed.
For me it looks like the documentation is wrong.
@daniel.pan
So, how can I work it out? Does anyone experience the same as me?
@shoeper Do you have another seafile server which is not in production, can you help me try to get the client login url with a right token generated from that server in order to make sure that it wasn’t my server’s fault?
And additional information here:
Seafile Server Version: CE 6.2.5 (has just been upgraded to 6.3.2)
Database using: SQLite
Operating System: Ubuntu 16.04.3 LTS x64
If you want any more details about my server, please reply to me.
Thanks.
After I upgraded the seafile server to 6.3.2, the same error still occurs.
In case anyone is looking for a solution.
First, the /api2/client-login/ method doesn’t allow GET requests, but POST is available. It returns a JSON with a token instead of a full URL as the documentation says.
Next, the token can only be used to log in as a staff user. Simply add the retrieved token as a GET parameter to the following URL:
SEAFILE_INSTALLATION_URL/client-login/?token=RETRIEVED_TOKEN