Bird
0
0

What will happen if a JWT's signature does not match the header and payload during verification?

medium📝 Conceptual Q5 of 15
Rest API - Authentication and Authorization
What will happen if a JWT's signature does not match the header and payload during verification?
AThe payload is automatically refreshed
BThe token is accepted without verification
CThe token is considered invalid and rejected
DThe header is ignored but payload is accepted
Step-by-Step Solution
Solution:
  1. Step 1: Understand JWT signature role

    The signature ensures the token was not tampered with by verifying header and payload.
  2. Step 2: Consequence of signature mismatch

    If the signature does not match, the token is invalid and must be rejected for security.
  3. Final Answer:

    The token is considered invalid and rejected -> Option C
  4. Quick Check:

    Signature mismatch = Token rejected [OK]
Quick Trick: Invalid signature means reject token [OK]
Common Mistakes:
  • Accepting tokens without signature check
  • Assuming payload refresh on mismatch
  • Ignoring signature errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes