Error codes · Keys and signatures

Invalid credentials

Codeinvalid_credentials
Status401
If this was an orderThis request bought nothing
Send it again unchanged?No — change something first
.NET SDKInvalidCredentialsException

What it means

Anis could not authenticate the call: the key id is unknown, the key is not active (not yet confirmed, revoked or expired), the signature does not match the request, the signature is too old or signed on a clock that is out, or the body does not match its Content-Digest. All of these get this same answer on purpose, so a refusal never tells anyone which one to work around.

What to do

  • Check that the key id and the private key you sign with belong together.
  • Check that the key is active: the enrolment status reports active once Anis staff confirm it.
  • Check your server clock, and sign each attempt afresh — never reuse an old signature.
  • Compute the Content-Digest over the exact bytes you send.
  • Run the signature self-check: it reports exactly what Anis saw. If the self-check is refused too, the key itself is the problem.

Where you can meet it

Example

The body of the refusal. Its type is the address of this page.

{
  "type": "https://developers.anis.ly/errors/invalid-credentials",
  "title": "Invalid credentials",
  "status": 401,
  "code": "invalid_credentials",
  "requestId": "01J9R2K8T4V6XQ0M3B7C5D9E1F"
}