Bird
0
0

Given a microservice receiving a JWT access token, which step correctly validates the token before processing the request?

medium📝 Analysis Q13 of 15
Microservices - Authentication and Authorization
Given a microservice receiving a JWT access token, which step correctly validates the token before processing the request?
ADecrypt the token and store it in a database
BCheck token signature, verify expiration, and confirm required scopes
CSend the token to the user service for validation every time
DIgnore the token if the request comes from a trusted IP
Step-by-Step Solution
Solution:
  1. Step 1: Understand JWT validation steps

    JWT tokens are validated by checking their signature, expiration time, and scopes to ensure authenticity and permission.
  2. Step 2: Eliminate incorrect practices

    Decrypting JWT is incorrect because JWTs are signed, not encrypted; querying user service every time reduces scalability; trusting IP alone is insecure.
  3. Final Answer:

    Check token signature, verify expiration, and confirm required scopes -> Option B
  4. Quick Check:

    JWT validation = signature + expiry + scopes [OK]
Quick Trick: Validate JWT by signature, expiry, and scopes locally [OK]
Common Mistakes:
MISTAKES
  • Trying to decrypt JWT instead of verifying signature
  • Validating tokens by calling user service every request
  • Trusting IP addresses instead of tokens

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes