Open shark8me opened 5 years ago
Looks strange. Does Koi use the HTTP basic auth directly or does it issue a token?
Might be work putting in some log statements for the http calls.
Koi supports both basic and token auth. In Koi's case, this is handled by buddy middleware, and hence is a bit hard to debug using log statements. Surfer doesn't use middleware for this endpoint.
Wireshark traces show some interesting results on these requests.
Turns out that the Apache HTTPClient
auth/token
without an authentication headerIt turns out that Koi-clj doesn't appreciate a POST to auth/token
without an authentication reader, and sends a HTTP 400 (bad request) back.
I'll have to try and modify Koi to not send a 400 bad request.
However its not clear why the HTTP Client should send a POST to auth/token
without an authentication header.
@shark8me: code updated and merged the same, kindly review.
@AyushVerma2 This needs to be fixed in Koi Just to clarify: Koi accepts agents created with auth-tokens. Koi's auth doesn't return a token when passed a username+password, since the Apache HTTP Client first send a request without auth, which Koi rejects as not having authorization.
There seem to be subtle differences in Auth endpoint handling on calling POST on
/auth/token
between Surfer and Koi. Ideally they should be treated equally.While getting an Operation from an Meta Endpoint hosted on Koi, Starfish-clj throws a 401 exception, but is successful at getting an Operation from a Surfer hosted meta endpoint.
Using curl, there is no difference in making the request to both servers, and it doesn't offer a clue as to why the requests should fail on Koi-clj.
On Koi:
and on Surfer: