0
0
Microservicessystem_design~10 mins

Centralized vs distributed auth in Microservices - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the component responsible for user authentication in a centralized auth system.

Microservices
auth_service = [1]()  # This service handles all user login requests centrally
Drag options to blanks, or click blank then click option'
ALoadBalancer
BUserDB
CCache
DAuthServer
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a database or cache as the auth handler instead of a dedicated auth server.
2fill in blank
medium

Complete the code to represent a token verification step in a distributed auth system.

Microservices
if service.verify_token([1]):
    grant_access()
Drag options to blanks, or click blank then click option'
Ajwt_token
Bpassword
Cuser_credentials
Dsession_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using raw passwords or credentials instead of tokens for verification.
3fill in blank
hard

Fix the error in the code that incorrectly tries to validate tokens in a distributed system by calling a central auth service synchronously.

Microservices
def authenticate(token):
    token = [1].validate_token(token)
    return token
Drag options to blanks, or click blank then click option'
ACentralAuthService
BLocalTokenVerifier
CCacheService
DDatabaseConnector
Attempts:
3 left
💡 Hint
Common Mistakes
Calling the central auth service synchronously causing delays and bottlenecks.
4fill in blank
hard

Fill both blanks to complete the code that shows how a distributed auth system validates a token and extracts user info.

Microservices
if [1].validate([2]):
    user = [1].extract_user([2])
Drag options to blanks, or click blank then click option'
ATokenService
BAuthServer
Cjwt_token
Duser_credentials
Attempts:
3 left
💡 Hint
Common Mistakes
Using user credentials instead of tokens for validation in distributed auth.
5fill in blank
hard

Fill all three blanks to complete the code that demonstrates centralized auth issuing a token after verifying credentials.

Microservices
def login(user_input):
    if [1].verify([2]):
        return [3].issue_token([2])
    else:
        return None
Drag options to blanks, or click blank then click option'
ACentralAuthService
Buser_input
CTokenIssuer
DLocalTokenVerifier
Attempts:
3 left
💡 Hint
Common Mistakes
Using local token verification or wrong variable names in centralized auth flow.