🎫 Díchódóir JWT

Díchódaigh JSON Web Tokens (JWT) chun breathnú ar an gceanntásc (header), a phálasta (payload) agus a shíniú.

Cad is JSON Web Token (JWT) ann?

Is bealach dlúth, slán é JWT chun eolas a léiriú (éilimh/claims) aistarraing idir dhá pháirtí. Úsáidtear go forleathan é i gcúrsaí logála isteach.

Struchtúr JWT

  • Ceanntásc: Sonraíonn sé an algartam a úsáidtear don tsíniú. Contains the signing algorithm (e.g., HS256, RS256) and token type.
  • Pálasta: Sonraí úsáideora. Contains claims — statements about the user and additional metadata.
  • Síniú: Ciallaíonn seo nach féidir na sonraí do JWT a leasú. Verifies the token hasn't been tampered with. Created using the header, payload, and a secret key.

Ceisteanna Coitianta

An bhfuil díchódú sábháilte in úsáid anseo ar líne?

Tá go deimhin. Soláthraíonn JavaScript an méid oibre ar fad ag gléas an bhrabhsálaí seo seachas cuig áit ar bith eile lasmuigh.

Gach comhartha atá éagtha chugat cad is brí le seo?

"'Exp' is comhartha chugat maidir leis an díchódú, ní incheaptha go dtug sé logáil leithleach d'aon oibreán a úsáideann freastalaí ar líne do dhífhorbairt.

Decodes JSON Web Tokens showing header, payload, and signature without requiring the secret key, for debugging auth flows.

Key Facts

  • Standardized in RFC 7519 (2015)
  • 80%+ of modern APIs use JWT
  • Three parts separated by dots (.)
  • Common algorithms: HS256, RS256

Frequently Asked Questions

What is a JWT?

Compact, URL-safe token with header (algorithm), payload (claims), and signature for API authentication.

Is decoding JWT safe?

Yes — payload is base64-encoded, not encrypted. Security is in signature verification, not content hiding.

What are JWT claims?

Statements about user: iss (issuer), sub (subject), exp (expiration), iat (issued at), aud (audience).

How long should JWT last?

Access tokens: 15-30 min. Refresh tokens: 7-30 days. Short-lived limits damage if compromised.