Q4: What is the difference between Symmetric (HS256) and Asymmetric (RS256) JWT signing?
- HS256 (HMAC with SHA-256): Uses a single shared secret key for both signing and verifying the token. Both the Auth Server and Resource Server must share and store the identical secret key securely.
- RS256 (RSA Signature with SHA-256): Uses an asymmetric key pair. The Authorization Server signs the JWT using its Private Key, while external Resource Servers verify the signature using the Authorization Server's public key (fetched via JWKS).
RS256 Asymmetric Verification Architecture
Key Takeaways
HS256 requires sharing secret keys between Auth Server and APIs; RS256 requires exposing only public keys.
RS256 is the industry standard for microservice architectures and third-party API consumers.