Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to enforce 'sessions' in RESTful web services using RESTlet?
    primarykey
    data
    text
    <p>I am new to RESTful web services and RESTlet. WE only have experience building servlet based web applications (Servlet/JSP on JBoss/Apache). Now, we are building a RESTlet based application where the server side API would be used by two types of clients - web using browser and swing based via desktop. </p> <p>What I understand is that as per REST concepts a) server can not maintain sessions to improve scalability and few other reasons b) each request from client should be self-contained </p> <p>Now, I am really confused how to achieve this. Suppose we take a simple shopping cart application. </p> <p>Step 1) Client sends the authentication request, server authenticates and server responds OK. </p> <p>Step 2) Client sends a request to add an item to the shopping cart. Server responds OK.</p> <p>Step 3) Client sends another request to add 2nd item to the shopping card. Server responds OK.</p> <p>Normally, in a normally web app, a session is created in Step 1 on server and from that point onwards all the requests pertaining to that client are automatically associated with the same session and we store session state (Shopping Cart in this case) in the session object and retrieve/update it with subsequent requests from the client. </p> <p>Now, in the above scenario:</p> <p>1) how do we authenticate and authorize Client in Step 2 and 3 if there is no session maintained on the server ? </p> <p>2) does client need to send some additional information with each request ?</p> <p>3) How do we retrieve the client specific Shopping Cart in Step 3 ?</p> <p>4) Does the client need to send it's Shopping Cart that was created/returned by server in Step 2 again in Step 3 ? </p> <p>Obviously, this is the simplest use case and so every one developing RESTful web services must be designing their app to handle this. What is the best and most common way to handle session management, authentication, authorization in RESTful web services using RESTLet ? If we have to maintain cache on server side with the client's data then how is this different from server maintaining sessions on our behalf ?</p> <p>Thanks in advance, Deep</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload