# authentication_unavailable

> The token could not be checked

- Status: 401 Unauthorized
- Returned by: /api/public
- Operations: [createOrder](https://developers.rivr.io/reference/api-public/createOrder.md), [getOrder](https://developers.rivr.io/reference/api-public/getOrder.md), [getOrderStatus](https://developers.rivr.io/reference/api-public/getOrderStatus.md), [getOrderReceipt](https://developers.rivr.io/reference/api-public/getOrderReceipt.md), [refundOrder](https://developers.rivr.io/reference/api-public/refundOrder.md), [cancelOrder](https://developers.rivr.io/reference/api-public/cancelOrder.md), [sendOrderToDevice](https://developers.rivr.io/reference/api-public/sendOrderToDevice.md), [getDevices](https://developers.rivr.io/reference/api-public/getDevices.md), [getHealthSecure](https://developers.rivr.io/reference/api-public/getHealthSecure.md), [listMerchants](https://developers.rivr.io/reference/api-public/listMerchants.md), [getMerchant](https://developers.rivr.io/reference/api-public/getMerchant.md), [listOrderSettlements](https://developers.rivr.io/reference/api-public/listOrderSettlements.md), [getOrderSettlement](https://developers.rivr.io/reference/api-public/getOrderSettlement.md), [getNextUnreadSettlement](https://developers.rivr.io/reference/api-public/getNextUnreadSettlement.md), [createSubscription](https://developers.rivr.io/reference/api-public/createSubscription.md), [getSubscription](https://developers.rivr.io/reference/api-public/getSubscription.md)
- Retry (`retryWhen`): `same_request`
- Did anything happen? (`outcome`): `none` (It did not happen)
- Rivr's services
- Page in the portal: https://developers.rivr.io/errors/authentication_unavailable
- Try it: `GET https://developers.rivr.io/errors/simulate/authentication_unavailable` answers with the code's exact wire form; `?succeedAfter=N&attempt=K` gives a 200 once `attempt` passes `N`

## What it means

rivr-auth's keys could not be fetched just now, so the token could not be checked. It is not the token's fault. The status is 401 for historical reasons; changing it to 503 would be a breaking change. In `/api/public` it applies to a token from rivr-auth, and `error` and `error_description` stay.

## What your system does

Try again in a moment with the same token; it goes through once rivr-auth answers. Don't replace the token and don't ask the user to sign in again.

## Is it worth retrying?

Only once the situation has changed, see above. Sending the same call straight away gets the same answer.

`retryWhen`: `same_request`. Send the very same request again, unchanged: the same `Idempotency-Key` and the same order id. Wait `Retry-After` seconds when the answer has the header, otherwise a short while that grows with each attempt.

## Did anything happen?

`outcome`: `none`. **It did not happen.** This call did not do what you asked for and changed nothing else that you can see or that concerns money. Where the code has an `outcomeNote`, it takes precedence.

## Example: /api/public

```http
HTTP/1.1 401 Unauthorized
Content-Type: application/json

{
  "error": "unauthorized",
  "error_description": "Authentication service unavailable",
  "propertyName": null,
  "message": "The token could not be checked right now. Retry the request with the same token.",
  "errorCode": "authentication_unavailable",
  "code": "authentication_unavailable",
  "type": "https://developers.rivr.io/errors/authentication_unavailable"
}
```

The `title`, `detail`, `message` and `error_description` texts are exactly as the API writes them today.
