Skip to content

Unauthenticated

FieldValue
Type URIhttps://echo.labstack.com/pro/problems/unauthenticated
Codeunauthenticated
HTTP status401
HTTP statusEnglish title
401Unauthorized

The application refused the request because authentication failed or was missing. It returns this code only when it knows authentication failed. It keeps its own WWW-Authenticate challenge.

Authenticate as the WWW-Authenticate challenge describes, then retry.

If your application installs a custom handler, the body may differ.

HTTP/1.1 401 Unauthorized
Content-Type: application/problem+json
{
"code": "unauthenticated",
"status": 401,
"title": "Unauthorized",
"type": "https://echo.labstack.com/pro/problems/unauthenticated"
}

For API keys, check revocation and the pepper version. For bearer tokens, check issuer, audience, signature and expiry. Never log the rejected credential.

  • type (string, always): The exact type URI above.
  • title (string, always): The catalog title in the rendered language: English by default, Japanese only when the application selects it.
  • status (integer, always): The HTTP status of the response.
  • code (string, always): The stable code above.
  • detail (string, optional): Display text that your application sets, up to 256 bytes with problem.NewError. Omitted when you set none.

Headers:

  • Cache-Control (conditional): no-store, set by problem/echoadapter.
  • Content-Language (conditional): en or ja, set by problem/echoadapter from its configured language.
  • WWW-Authenticate (conditional): The application’s own challenge, kept by problem/echoadapter.

Notes:

  • The adapter keeps existing WWW-Authenticate, Allow and Retry-After headers and adds no challenge or retry advice of its own.
  • On HEAD, the adapter’s Content-Length equals the GET body’s length.

See the problem catalog for application error handling.