Reputation: 22683
I'm building a single-page web application, fully based on RESTful API. I've seen several topics in that matter, but some things remain unclear for me.
I will need users to log in. Here are some of my ideas:
keys
table and add random keys each time somebody logs in. On logout, the key would go away and no longer be valid. This is more secure than previous idea.How is it solved in simple projects? I'd like to make it simple but not ridiculously inserure.
Please help.
Upvotes: 1
Views: 3105
Reputation: 202156
The commonly approach is to use the header Authorization in REST. The state of the application must be on the client side with REST and shouldn'a be tied to a particularly client kind (browser with cookies)
I think that this link could be helpful:
There is also à great question to à similar question here : https://softwareengineering.stackexchange.com/questions/141019/should-cookies-be-used-in-a-restful-api
Hope it helps, Thierry
Upvotes: 1