Your backend must verify the signature and claims before trusting the token.
JWKS (Public Keys)
To verify signatures, fetch OTPless public keys from:- Recommended (secure):
https://otpless.com/.well-known/jwks
RS256 signatures.You must select the key where
kid matches the JWT header.
Example JWT ID Token
Header
Payload
Claim Reference
Verification Checklist
-
Signature
- Verify using RS256 with OTPless JWKS (
https://otpless.com/.well-known/jwks).
- Verify using RS256 with OTPless JWKS (
-
Issuer (
iss)- Must equal
https://otpless.com.
- Must equal
-
Audience (
aud)- Must equal
PXXXXG1XXXX1NXXYAO.
- Must equal
-
Time claims
exp> current time (allow ±60s skew).iatandauth_timeoptional checks.
-
App-specific checks
- Ensure
phone_number_verified: truebefore granting sensitive access. - Use
subas the stable user identifier.
- Ensure
-
Algorithm hardening
- Accept only
RS256. - Reject tokens with
alg: noneor unexpected algorithms.
- Accept only
Code Examples
Node.js (Express) — jose
Java (Spring Boot) — Nimbus JOSE + JWT
Python (Flask/FastAPI) — authlib
Go (net/http + jwx + golang-jwt)
Best Practices
- Cache JWKS (5–15 minutes). Refresh when a
kidis not found. - Always use HTTPS JWKS endpoint in production for security.
- Strictly check
issandaud. - Allow a small clock skew (30–60s).
- Reject unexpected algorithms (only
RS256). - Use
phone_number_verifiedbefore sensitive operations. - Never trust a JWT by simply decoding — always verify signature.