I am developing a new experimental web application framework and I decided to give RESTful some attention. I read about the basic principles and feel that I have a pretty good understanding of RESTful as a concept.
My system works and works, using URLs strictly to define "nouns" in the system and I take "verbs" from HTTP request methods. I use javascript ajax calls to provide access to the DELETE and PUT methods that HTML forms cannot provide. (I understand that these measures do not have to be RESTful, but it satisfies the requirements of the "Uniform Interface").
The problem is the lack of state and authentication caching. The standard model of user authentication on websites includes an “login” authentication event, after which (if successful) the user is “inside the wall” with a constant secure session and can see and do something in subsequent requests that may be unauthenticated users. This authentication strength seems to violate RESTful-ness. Caching and statelessness seem to be violated because the authenticated user is likely to see HTML that is different from what the unidentified user sees for the same request (for example, there may be a login form in the sidebar for the log, user) .
Using www-authenticate strategies to authenticate a user only on requests requiring authentication seems to be a step in the right direction, since it does not include the concept of a permanent secure session. However, the question still arises of how to portray the “login” for the end user in accordance with what we all expect from websites.
So, in current thinking, what is the preferred way to handle authentication and web page resolution in a strictly RESTful way, while maintaining permission to enter the layout in HTML?
Jonathan hanson
source share