user image

Dev-Mo
Published in : 2022-02-12

Difference between frontend and backend user authentication

General

I was lately asked to explain the distinction between frontend and backend user authentication ( as an interview question ). I couldn't think of anything to say in response to his query. He inquired if the authentication you see on the web is done at the frontend or the backend, and I replied that it is done at the backend. Then he asked, "What is frontend authentication?" I was stumped. I looked it up on the internet, but couldn't discover an accurate distinction between what is performed on the frontend and what is performed on the backend. What are the uses, where are they used, and why are they utilized?

Comments

Mohamed Atef Date : 2022-02-12

Best answers

46

Best answers

46

Frontend authentication is like using middleware or Web Guard to protect the pages which need authentication like profile page & dashboard, you can handle this by saving Cookies or localStorage & creating service files and it should use Tokens came from the backend when the user signup or sign in and refresh the tokens using specific endpoint to keep the user authenticated on both frontend and backend.

Mohamed Aboelfotoh Date : 2022-02-12

Best answers

4

Best answers

4

A unique cookie is provided to the browser when a user is authorised on the backend, according to my understanding. This is referred to as frontend authentication since it permits users to continue to use a website without having to check in to each individual page. For each future call, the website identifies the user based on the cookie data, subject to any constraints set in place.

A cookie that holds the login and password is a basic example, but it is obviously not particularly safe. Encryption, SSL, and different flags (secure, http-only, expiry-date, and so on) would be used in more advanced approaches.

Anyway  it is a big and diverse topic.. you can read more about Authentication Mechanisms for HTTP

I hope this was helpful!

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

Searching for free live chat service
Publish date: 2022-02-11 | Comments: 2

Tag: General

[solved] Unable to pull updates from git "sudo git pull"
Publish date: 2021-12-20 | Comments: 1

Tag: General

what is alternative for sending mail through Gmail SMTP?
Publish date: 2022-06-08 | Comments: 1

Tag: General

Select from a query with peewee
Publish date: 2022-03-05 | Comments: 0

Tag: General

How do i r etrieve users?
Publish date: 2022-03-04 | Comments: 0

Tag: General

Keycloak db query in source codes [closed]
Publish date: 2022-03-05 | Comments: 0

Tag: General

How to checkout to new created branch on bitbucket
Publish date: 2022-03-03 | Comments: 1

Tag: General