0
0
Microservicessystem_design~5 mins

Authentication at gateway level in Microservices - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main role of an API gateway in microservices architecture?
An API gateway acts as a single entry point for all client requests. It routes requests to appropriate microservices, handles cross-cutting concerns like authentication, logging, and rate limiting.
Click to reveal answer
intermediate
Why is authentication at the gateway level beneficial?
It centralizes authentication, reducing duplicated code in microservices, improves security by enforcing consistent policies, and simplifies client interactions by handling tokens and credentials in one place.
Click to reveal answer
intermediate
What is a common method used by gateways to authenticate requests?
Gateways often use JSON Web Tokens (JWT) to authenticate requests. The gateway verifies the token's signature and claims before forwarding the request to microservices.
Click to reveal answer
beginner
How does the gateway handle an unauthenticated request?
The gateway rejects the request immediately, usually returning a 401 Unauthorized response, preventing unauthenticated traffic from reaching microservices.
Click to reveal answer
advanced
What is a potential drawback of authenticating only at the gateway?
If microservices trust the gateway blindly, a compromised gateway could allow unauthorized access. Also, internal service-to-service authentication might still be needed for defense in depth.
Click to reveal answer
What does an API gateway primarily do in microservices?
AManages database transactions
BStores user data
CActs as a single entry point and handles authentication
DRuns background jobs
Which token type is commonly verified by gateways for authentication?
AJWT (JSON Web Token)
BSAML
COAuth 1.0
DAPI Key
What response does a gateway send if authentication fails?
A200 OK
B403 Forbidden
C500 Internal Server Error
D401 Unauthorized
What is a key benefit of authenticating at the gateway instead of each microservice?
AIncreases network traffic
BCentralizes authentication logic
CRequires more code in each microservice
DSlows down request processing
What is a security risk if microservices trust the gateway without additional checks?
AGateway can become a single point of failure
BMicroservices will run slower
CClients must authenticate twice
DGateway will reject all requests
Explain how authentication at the gateway level works in a microservices architecture.
Think about how the gateway checks credentials before letting requests reach microservices.
You got /4 concepts.
    Discuss the advantages and potential risks of handling authentication only at the gateway.
    Consider both the simplicity and the security implications.
    You got /4 concepts.