HTTP status code

ms-shin·2023년 3월 25일
0

Informational (100-199)
Success (200-299)
Redirection (300-399)
Client Error (400-499)
Server Error (500-599)

이는 RFC9110에서 정의되어있다.
https://www.rfc-editor.org/rfc/rfc9110.html

Over to you: HTTP status code 401 is for Unauthorized. Can you explain the difference between authentication and authorization, and which one does code 401 check for?

  • Authentication: 유저나 시스템의 신원을 확인하는 절차
  • Authorization: 유저가 특정 리소스에 접근 권한 또는 행동 권한을 가지고 있는지를 확인하는 절차

그래서 401 (Unathorized)가 의미하는 것은 클라이언트가 인증되지 않았거나 인증되었지만 요청한 리소스에 대한 필요한 권한이 없는 것을 의미합니다

요약하자면, 인증(Authentication)은 사용자의 신원을 확인하는 과정이고, 인가(Authorization)는 사용자가 액세스할 수 있는 리소스를 결정하는 과정입니다. HTTP 상태 코드 401은 인증(Authentication)을 확인하며, 클라이언트가 요청한 리소스에 액세스하려면 유효한 자격 증명을 제공해야 함을 나타냅니다.

profile
지식을 깊게 파고드는 개발자입니다.

0개의 댓글