News for hackers. Stuff that matters.
Re:Why and How You Should Write REST-Centric Applications by ataggart on Wednesday May 18, 2011 @01:02PM (#2560779)
One approach I've seen regarding auth is to use a faux-resource:

Login:

    PUT https://example.com/credentials
    {"username":"foo", "password":"bar"}
Check if user is logged in:

    HEAD http://example.com/credentials
    Cookie: ...
Get current user:

    GET http://example.com/credentials
    Cookie: ...
Logout:

    DELETE http://example.com/credentials
    Cookie: ...
From the point of view of the one client, it's no less "real" than any other resource.

There are no comments on this comment yet.