Use it when calls start failing with 401 after working earlier (expiry), when deciding token lifetime and storage, or after a token may have leaked.
REST API Tokens
Tokens are API credentials whose permissions, audience, lifetime, rotation and revocation must follow the target API contract.
1. Decode the JWT and check iss, aud, exp and scopes.
2. Validate the signature against the issuer's keys.
3. Short-lived access tokens; revoke refresh tokens on compromise.
client authenticates to the token endpoint → short-lived access token issued (scope, audience, expiry) → sent as Bearer on each request → server validates signature, expiry and audience → expired: 401, obtain a new one → revoke on compromise
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Read-only Verification Verify boundary
Review supported authentication, issuance policy, expiry and revocation behavior without copying live tokens into the reference or command history.
Step 2 Common mistakes Narrow the fault
- Not validating
audand signature. - Storing tokens in browser local storage.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
A syntactically valid token or one successful request does not prove correct scope, audience or revocation enforcement.
Decode the token — a JWT is three Base64 parts — and read exp, aud, iss and the scope. Call the API with an expired token → 401. Check where tokens are stored and that they are never written to logs.
ReferenceWhat it is1 section · depth on demand
Direct Answer
Tokens are API credentials whose permissions, audience, lifetime, rotation and revocation must follow the target API contract.
ReferenceHow it works1 section · depth on demand
Technical Mechanics
Bearer-token possession can be sufficient to use its granted authority. Protect tokens in transit and storage, minimize scope/lifetime where supported, and do not place them in query URLs or shared logs. Generic token guidance does not establish token support on IOS / IOS XE RESTCONF.
ReferenceImportant terms & boundaries4 sections · depth on demand
Official Sources
Proof Boundaries
A syntactically valid token or one successful request does not prove correct scope, audience or revocation enforcement.
In depth
Tokens for REST APIs
Most APIs use bearer tokens. RFC 6750 explains the key property: whoever holds a bearer token can use it, with no proof of possession of a key, so the token must be protected in storage and in transit. Clients should send it in the Authorization: Bearer header; sending it in a URI query parameter is discouraged because URLs are often logged.
Handling rules (RFC 6750)
| Rule | Detail |
|---|---|
| TLS always | Tokens must never cross unencrypted connections; clients validate the server certificate |
| Header, not URL | Authorization: Bearer <token> |
| Short lifetime | One hour or less recommended |
| Audience restriction | A token for one resource server can't be used at another |
| No unencrypted cookies or page URLs | Avoid leaks through history and logs |
| Integrity | Tokens signed or MAC-protected, or references to unguessable server-side data |
Errors (RFC 6750)
| Error | Typical status | Meaning |
|---|---|---|
invalid_request | 400 | Malformed request, for example two token methods |
invalid_token | 401 | Expired, revoked or malformed token |
insufficient_scope | 403 | Token lacks the required privileges |
admin$ curl -s -D - -o /dev/null -H "Authorization: Bearer $OLD_TOKEN" https://ctrl.example.net/api/v1/devices | grep -i -E "^HTTP|www-authenticate"
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer error="invalid_token", error_description="The access token expired"
admin$ jq -R 'split(".") | .[1] | @base64d | fromjson | {iss, aud, exp, scope}' <<< "$TOKEN"
{
"iss": "https://idp.example.net",
"aud": "ctrl.example.net",
"exp": 1764331200,
"scope": "network.read"
}
Refresh tokens (RFC 6749)
Refresh tokens get new access tokens from the authorization server and are never sent to resource servers. Store them as carefully as passwords.
Threats (RFC 6750)
Token disclosure, replay, manufacture or modification, and redirection to another resource server. TLS, short lifetimes, integrity protection and audience restriction address them.
Documented example, not captured output.
Quick reference
Tokens represent an authenticated session: bearer tokens (anyone holding them can use them), JWTs (signed claims with expiry), refresh tokens (obtain new access tokens).
Good practice: short lifetimes (Catalyst Center tokens expire after 60 minutes), store tokens only in memory or secure stores, never log them, transmit only over TLS, validate signature, issuer, audience and expiry on the server side, and revoke on logout or compromise.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Expected output
Decoded JWT payloadExpected state: Issuer, audience, scope and expiry are what the API expects.
{
"iss": "https://auth.example.net",
"aud": "network-api",
"scope": "interfaces:read",
"exp": 1794700800
}
! Illustrative output, not captured Evidence.`aud` must name the API being called, `scope` limits what the token may do, and `exp` is the expiry in seconds since 1970. The payload is only encoded, not encrypted — anyone holding the token can read it.Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Security → REST API Security → Tokens. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%