You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sticky session binds a session to a server. If the server goes down or needs to be maintained.
Sticky session needs to store session data in load balancer.
Possible solutions:
Session synchronization by replicating across web servers
Store session data completely inside users' browser
Cons: Limited size of cookie
Store session data in a shared storage
Auth Service and token
Pros:
Encapsulate everything related with token issuing
Introduce the concept of token, which could be passed around between services
Cons:
Services need to implement the logic to validate the token.
All services need to talk to authSvc, which might become a performance bottleneck.
All requests need to be verified via auth service.
Gateway and token
Pros:
Gateway centralizes the logic of parsing userInfo. Only gateway need to validate the token with auth service.
Cons:
All requests need to be verified via auth service. Auth service needs to be maintained and scaled in a manageable way.
Gateway and JWT
Pros:
Compact and lightweight
Low pressure on Auth server
Simplify the implementation of auth server
Cons:
Could not invalidate a JWT token if it has been leaked
JWT might become big
JWT
Motivation
JWT is a type of by value token which does not need to be verified at the authorization server.
Def for by reference token: Randomly generated string value. Upon receiving the token, resource server needs to verify it against OAuth authorization server to obtain information such as claims/scopes.
Def for by value token: A token which contains key value pair of (issuer, audience, scope, claims). It could be verified locally and does not need to be verified against authorization server.