concept authenticate state in category sails

appears as: authenticated state, uthenticated state, n authenticated state
Sails.js in Action

This is an excerpt from Manning's book Sails.js in Action.

Table 6.1. Components of user identity, authentication, personalization, and access control

Component

Description

User identity management In chapters 6 and 7, you’ll create user identity management that enables a user to claim and manage an identity. This component will also enable a super user, referred to as administrator, to manage all identities. The subcomponents of user identity management will be implemented in two parts. The first part is setting up the model, whereas the second part is using the model to fulfill requirements of the backend API.
Frontend personalization Once you can determine whether a person is logged in or logged out, you’ll want to use that state to control what’s displayed on the frontend, also known as personalization. In chapter 7, you’ll communicate the authenticated state to the frontend, controlling which assets are displayed. In chapter 8, you’ll bootstrap the user’s authenticated state on the page using server-rendered views. You’ll then control what’s displayed on the frontend using a combination of server-rendered views and client-side JavaScript.
Authentication In chapter 9, you’ll create the authentication component. The authentication component provides a way to challenge the authenticity of a user’s claim to a specific identity and determine whether it’s genuine on the backend. You’ll store the results of the challenge (the authenticated state) between requests using sessions on the backend. Finally, using controller actions, you’ll route requests between pages on the backend, which takes the authenticated state from the session and bootstraps that state onto server-rendered views that can be used by the frontend.
Backend API access control Once a user is authenticated, you’ll turn to what they have access to in terms of the backend API. For example, only a user who is authenticated and is the owner of a profile may restore it.
Example 8.9. locals used to simulate the authenticated state of a user
...
locals: {
      me: {
        id: 1,
        gravatarURL:
         'http://www.gravatar.com/avatar/ef3eac6c71fdf24b13db12d8ff8d1264?',
        email: 'sailsinaction@gmail.com'
      }
    }
...

When we use the term authentication or authenticated state, we’re referring to whether a user’s claim, on behalf of a user-agent (in our case, a browser), is genuine or not. To provide authentication, you first needed a user identity. So you added a unique email address and a unique username to the user model as key attributes of a user’s identity. You also added a password attribute that will later be used as proof of a claim to a particular identity. Thus, your authentication component has three distinct subcomponents:

Figure 9.5. You started off using client-side routing before transitioning to custom backend routes serving server-rendered views. Now that you have the user’s authenticated state, you can move to a combination of custom routes that trigger a custom action for each view.