What is Authentication and Web Tokens

When requests to a web sever come in you have this process called authentication that lets the server figure out exactly who made that request.

Goal

Follow along to learn what is:

What is Authentication

It’s the process of identifying a user. When requests to a web sever come in you have this process called authentication that lets the server figure out exactly who made that request. It is generally followed by authorization which is a process by which the server figures out if that user has the correct permissions to do what they want to do.

Types of Authentication Methods

There are a various number of authentication methods:

HTTP Basic authentication

Cookies

Tokens

Token-Based Authentication

In token based authentication a user recieves a token upon login. With every single request to the server, they send that token just as a reminder ‘this is who I am, I am allowed to do this’. The server will compare that token against what they expected the token to look like and authorize the user if they have the correct permissions.

What are the benefits of using tokens

Some benefits to using tokens are:

JWTs

Stands for json web tokens and its the most basic form of a token. What this looks like is there are three parts, each one seperated by a period.

Information in the tokens are all base64 encoded which is just some different encoding method.

Using JWTs

There are three ways to send information (tokens) to a server:

The preferred way is to use the header. It is preffered because GET requests don’t have a Body. It is more secure to not use URL parameters because they get saved to the user’s history.

conclusion

Authentication is the process that lets a server figure out exactly who made a request to it. Authorization is a process by which the server figures out if that user has the correct permissions to do what they want to do. Tokens are a form of authentication in which users send a token, that contains information about them, with every request they make.

css
What is BEM

Keeping track of every single HTML element might become difficult. There's this CSS naming convention called block element modifier, also known as BEM. What it means is there are three different CSS classes of tags.

css
Media Queries and Responsive Design

Styling your site to look different depending on the size of a screen it is being viewed on is known as responsive web design.