Skip to content

561 Unauthorized (AWS ELB)

Meaning

A non-standard status code used by AWS Elastic Load Balancer (ALB/ELB) when it is configured with user authentication and the upstream identity provider reports an unauthorized error. Essentially, the load balancer is indicating the user couldn't be authenticated by the IdP.

When to Use

When an AWS Application Load Balancer is handling authentication (via OIDC or Cognito, etc.) and the authentication attempt fails (for reasons other than just missing credentials), it can surface a 561 error to the client. This means the authentication to an external IdP did not succeed.

Example

An ALB with built-in OAuth2 authentication redirects a user to sign in. If the identity provider responds with an error (like invalid credentials or user not authorized), the ALB might return 561 Unauthorized to the client to indicate the final outcome of authentication was failure.

When Not to Use

Do not expect to use this code outside of AWS load balancers. It's not a part of the HTTP standard. In normal applications, a 401 or 403 would be used for unauthorized access. 561 is specifically part of AWS’s custom status reporting for authentication integration.

Source

Unofficial (AWS ELB)


Released under the MIT License.