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

51

Best answers

51

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

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

Tag: General

Is it possible to git commit files without adding a message or comments?
Publish date: 2022-03-02 | Comments: 2

Tag: General

Connecting jupyter notebook with Android studio
Publish date: 2022-03-05 | Comments: 1

Tag: General

Password authentication is temporarily disabled as part of a brownout.
Publish date: 2021-07-28 | Comments: 2

Tag: General

Where can I find cheap Java and Mysql hosting server?
Publish date: 2022-05-03 | Comments: 3

Tag: General