tool::http-status-detail
401 Unauthorized
Authentication is required and has failed or not been provided.
상태 코드
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