We'll double click it real soon. And usually this token or session is using it in following requests. This is usually done so the user won't have to provide all the proof in every request. So usually you authenticate once, get a token or a session and use it for a certain amount of time. And the verification part after you get a session you usually provide this session or token and the application only needs to validate it.
So if we are talking about session management, we talked about session versus token, there are two technical processes to implement this. One is use server side session and the other user client side token. So a session usually means that the server stores its database, the session information and provides an identifier to the client and in subsequent requests and this session ID is used to retrieve the session information from the database. The server side session is usually very secure, the server which is a secure place has full control over it. For example, if you want to revoke a session, it's something that is a relatively simple to do in server side session, and on the other side there are client-side tokens.
I think someone in the chat mentioned before about JOTS. JOTS are basically the acronym of JSON Web Tokens, and this is a JSON that contains information about who you are, and it signs in asymmetric manners with a private key in the backend, in the server, and the token itself, all the token is sent to the client and in subsequent requests the JOT is basically validated and its information is used to determine, basically the server or the application can use to determine information about the user. Can someone maybe share what do you think are the advantages of client-side tokens, tokens, of JWTs? Okay, so I'll share that basically all all modern applications prefer to use a JWT for scalability manners. And so, basically, if you're talking about microservices architecture, you don't need to have a single point of access to access, for example, a database, and the performance of basically validating JWT is something that is relatively cheap to compute in comparing to accessing a database entity. And this is basically, I think that Kevin also wrote that you don't have to store the server session, and this is absolutely right.
One last thing before we jump into the coding session, let's describe the application that we are going to build. The application purpose, I'll demo it really quick in a minute, is basically to show the user some kind of financial revenue about the customer user organization. It doesn't really matter, but the important thing is that it shows it contains a resource and we want to protect this resource with an authentication layer. The application is composed with a desktop application, a web application, in React.js. We are not going to touch to spend time on the code, but if you want, you can go to the open source repo and take a look. The Node.js application server, this is what serves the information to the client. We are going to use a very simple express server. And another component is the authentication service. This is usually an external service that manages the user identity and authentication. Usually the application is communicating with the authentication service with an SDK library. In this workshop, we are going to use this code as the authentication service. OK. Right before we are starting, a few words about myself. My name is Asaf, as I said before. From this code, this code is authentication platforms that helps all developers to build security, security and frictionless authentication and to build user journeys for B2B apps, B2C apps and basically any app that you have.
Comments