From: "Dan Callaghan" dcallagh@redhat.com To: "beaker-devel" beaker-devel@lists.fedorahosted.org Sent: Thursday, 19 February, 2015 2:47:55 PM Subject: Re: [Beaker-devel] Receiving HTML rather than JSON despite Accept header
Excerpts from Nick Coghlan's message of 2015-02-19 14:26 +10:00:
However, the qualified listings still came back as a login redirect rather than giving me any data, even with a valid Kerberos ticket and passing --negotiate to curl.
Yes, sigh... The API does not actually use standard HTTP authentication. We can thank Kobo (and, indirectly, the limitations of xmlrpclib) for that one.
Authentication is described here:
https://beaker-project.org/docs/server-api/xmlrpc.html#authentication
and RFE for accepting standard HTTP authentication:
https://bugzilla.redhat.com/show_bug.cgi?id=1124139
although it's not straigh-forward due to compatibility with the existing /login redirect and form-based auth we have for the web UI.
I'm a fan of just adding a new dedicated JSON API endpoint that used standard auth, in order to bypass the tricky compatibility issues associated with trying to do the enhancement in place.
I know you think that's a horrible hack when it should be possible to do it through content negotiation without introducing new URLs, but the much simpler compatibility story may make it worth it.
I'm also still keen to look at using http://www.flaskapi.org/ to improve API discoverability, and that necessarily involves having the "browsable REST API" and the main UI (including the "single page applications" like the system page) anchored at different endpoints.
Cheers, Nick.