Summary
Authentication in Backbone applications can be tricky if you don't have a clear vision of how authentication works in REST servers. As Backbone is authentication agnostic, it does not force you to use an authentication mechanism. As a developer, it's your responsibility to create one or adhere to an existing one.
In Backbone Apps, backed by stateless servers, you should move the session handling code to the browser. In the examples shown in this chapter, we used sessionStorage to store the access tokens; however, you can use another storage solution such as localStorage and indexeddb, or even cookies.
Then, we saw how to combine the theory with the practical implementation of the Basic Auth and OAuth2 protocols in Contacts App. The implementation ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access