开发者

Restlet, GWT and Sessions

开发者 https://www.devze.com 2023-01-30 12:31 出处:网络
What is the best way to have a session between a Restlet Java API and GWT? In my app the user will login with a username and password and if it successfully authenticates the userID is returned. This

What is the best way to have a session between a Restlet Java API and GWT? In my app the user will login with a username and password and if it successfully authenticates the userID is returned. This is then stored in a cookie and used in calls to the API. This is obviously completely insecure because someone could just change the userID and start updating and retrieving another user.

Is the best way to also hand a token back with the userID and the API cal开发者_如何学Pythonls must contain that token?


The token is a good way and I've seen it in a lot of implementations. Usually, this is handed over as a simple parameter for each request. Following the RESTful idea you can also just include the credentials in the HTTP request each time.

0

精彩评论

暂无评论...
验证码 换一张
取 消