~/devtools / http-status / 401
tool::http-status-detail

401 Unauthorized

Authentication is required and has failed or not been provided.

ad · 728×90
상태 코드
401
이름
Unauthorized
카테고리
4xx

상세 설명

HTTP 401 Unauthorized는 요청에 유효한 인증 자격 증명이 없음을 나타냅니다. 이름은 'Unauthorized'이지만 실제로는 인증(Authentication) 실패를 의미합니다. 서버는 이 응답과 함께 WWW-Authenticate 헤더를 보내 어떤 인증 방식을 사용해야 하는지 알려줍니다. 403 Forbidden과 혼동하기 쉽지만, 401은 '누구인지 모름', 403은 '누구인지는 알지만 권한 없음'입니다.

주요 원인
  • ▸인증 토큰(Bearer, JWT 등)이 요청 헤더에 누락된 경우
  • ▸토큰이 만료되었거나 유효하지 않은 경우
  • ▸잘못된 사용자 이름/비밀번호 조합
  • ▸API 키가 잘못되었거나 비활성화된 경우
해결 방법
  • 1.Authorization 헤더에 올바른 토큰이 포함되어 있는지 확인하세요
  • 2.토큰이 만료되었다면 refresh token으로 새 토큰을 발급받으세요
  • 3.API 키가 유효하고 활성화 상태인지 확인하세요
  • 4.인증 방식(Basic, Bearer, API Key)이 서버 요구사항과 일치하는지 확인하세요

관련 HTTP 헤더

WWW-AuthenticateAuthorizationProxy-Authenticate

응답 예시

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="api"
Content-Type: application/json

{"error":"invalid_token","message":"Token has expired"}

관련 상태 코드

400Bad RequestThe server could not understand the request due to invalid syntax.→402Payment RequiredReserved for future use; some services use it for payment walls.→403ForbiddenThe server refuses to fulfill the request (authenticated but unauthorized).→404Not FoundThe requested resource could not be found.→405Method Not AllowedThe HTTP method is not supported for this resource.→
ad · 300×250
← 전체 상태 코드 목록으로 돌아가기
// related tools
⏱
Cron 표현식 생성기
Cron 표현식을 시각적으로 만들고 파싱합니다. 사람이 읽기 쉬운 설명과 다음 실행 시간을 미리 확인할 수 있습니다.
jwt
JWT 디코더
JWT 토큰을 디코딩하고 분석합니다. 헤더, 페이로드, 서명을 확인할 수 있습니다.
rx
정규식 테스터
정규식을 실시간으로 테스트합니다. 매칭 하이라이트와 설명을 제공합니다.
◑
색상 변환기
HEX, RGB, HSL 등 다양한 형식으로 색상을 변환합니다.