0
0
Microservicessystem_design~20 mins

OAuth 2.0 for microservices - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
OAuth 2.0 Microservices Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Architecture
intermediate
2:00remaining
OAuth 2.0 Token Flow in Microservices

Consider a microservices system where a client app needs to access multiple services securely using OAuth 2.0. Which component is responsible for issuing access tokens that microservices validate?

AClient app issues tokens; Resource Servers validate tokens.
BResource Servers issue tokens; Authorization Server validates tokens.
CResource Servers issue and validate tokens internally without Authorization Server.
DAuthorization Server issues tokens; Resource Servers validate tokens.
Attempts:
2 left
💡 Hint

Think about the OAuth 2.0 roles: who grants tokens and who protects resources.

scaling
intermediate
2:00remaining
Scaling Token Validation in Microservices

In a microservices architecture using OAuth 2.0, what is the best approach to efficiently validate access tokens across many services?

AMicroservices cache token introspection results locally with expiration times.
BEach microservice calls the Authorization Server synchronously for every token validation.
CMicroservices ignore token validation and trust the client app.
DMicroservices validate tokens by decrypting JWTs without any caching.
Attempts:
2 left
💡 Hint

Consider reducing network calls while keeping token validation secure and fresh.

tradeoff
advanced
2:00remaining
Choosing Between JWT and Opaque Tokens

Which is a key tradeoff when choosing JWT tokens over opaque tokens for OAuth 2.0 in microservices?

AOpaque tokens are always smaller and faster to validate than JWT tokens.
BJWT tokens require synchronous calls to Authorization Server for every request.
CJWT tokens allow stateless validation but can be large and harder to revoke immediately.
DOpaque tokens are self-contained and allow stateless validation without contacting Authorization Server.
Attempts:
2 left
💡 Hint

Think about token size, validation method, and revocation challenges.

🧠 Conceptual
advanced
2:00remaining
Role of Refresh Tokens in Microservices

In OAuth 2.0 for microservices, what is the main purpose of a refresh token?

ATo obtain new access tokens without requiring the user to re-authenticate.
BTo directly access protected resources without an access token.
CTo validate access tokens at the Resource Server level.
DTo revoke access tokens when a user logs out.
Attempts:
2 left
💡 Hint

Think about how long access tokens last and user experience.

estimation
expert
3:00remaining
Estimating Token Validation Load

A microservices system has 100 services, each receiving 1000 requests per second. Each request requires validating an OAuth 2.0 token. If each token introspection call to the Authorization Server takes 10ms, what is the minimum number of Authorization Server instances needed to handle token introspection without queuing delays, assuming each instance can handle 1000 introspections per second?

AAt least 50 instances to handle 50,000 introspections per second.
BAt least 100 instances to handle 100,000 introspections per second.
CAt least 1 instance since caching reduces load significantly.
DAt least 10 instances to handle 100,000 introspections per second.
Attempts:
2 left
💡 Hint

Calculate total introspection calls per second and divide by capacity per instance.