---
title: Errors
project: OpenAuth
version: 1.0
section: reference
language: en
license: MIT
url: https://totaljs.es/docs/openauth/1-0/reference/errors/
updated: 2026-11-19T09:22:03.917Z
---

# Errors

> What OpenAuth answers when a sign-in step fails.

OpenAuth answers most errors with a JSON array that holds an `error` text. A wrong token gets an HTML error page instead.

| Status | Answer | Where | Why |
|---|---|---|---|
| `400` | `[{"name":"serviceid","error":"The field \"serviceid\" is invalid",...}]` | `POST /` | A required field is missing. |
| `400` | `[{"error":"Service not found"}]` | `POST /` | No extension has that `serviceid`. |
| `401` | HTML page **401 Unauthorized** | `POST /`, `/sessions/`, `/setup/`, `/api/` | The token is wrong or missing, or the IP address is blocked for a while. |
| `404` | `[{"error":"Session not found"}]` | `/login/{id}/` | The sign-in address has expired (15 minutes) or OpenAuth was restarted. |
| `404` | `[{"error":"Session not found"}]` | `/oauth/{serviceid}/` | The provider sent the user back after the session expired. |
| `400` | `[{"error":"Invalid code"}]` | `/oauth/facebook/` | Facebook sent the user back without a code, for example because the user cancelled. |
| `404` | `[{"error":"Session not found"}]` | `/sessions/` | No finished sign-in with that ID. |

## Blocked IP address

After more than five requests with a wrong token from one IP address, OpenAuth answers `401` to every request from that address that needs a token, even with the right one, for up to 15 minutes. See [Sign-in questions](../../faq/sign-in/).

## What to do in your app

- On `404` at `/sessions/`, show "The sign-in has expired" and offer to start again.
- On `401`, check the token in your app's configuration and in [App tokens](../../guides/app-tokens/).
