To be Reviewed By:
Authors: Jinmei Liao/Dan Smith/Jacob Barrett/Joris Melchior
Status: Draft | Discussion | Active | Dropped | Superseded
Superseds: N/A
Related: N/A
Currently, when a user is authenticated into Geode, the credentials remain active in the server until user logs out or the client's cache is closed. However, in the token-based authentication scenario, credentials can expire when a client is still actively connected to the server, so we need a way to have the server reject further operations from the client when credential expires and notify the client to re-authenticate.
The first cut of the solution is to focus only on client-server connections. Pulse/Gfsh/Rest connections are outside of the scope of this RFC.
The Solution should have those effects
AuthenticationExpiredException, that can be thrown by the SecurityManager authorize method. SecurityManager authorize method is implemented by the third-party. We don't need to care how they determine user expiration. We just need to handle the AuthenticationExpiredExceptionIf it's thrown.ClientUserAuths. The entry is removed and the related shiro subject is logged out to prevent resource leaks when client's cache is closed. When an authentication expires, we need to do the same with the current authenticated subject and clean that entry out of the map as well. This logic needs to be added to the code path where the AuthenticationExpiredException is thrown.SecurityManager.authorize (in MessageDispatcher.runDispatcher or thereabouts).AuthorizationExpired token to the client. If the client is old, close the connection.AuthorizationExpired token, wait for a re-authorization request. Maybe only for some period of time before going back to 1 and trying again with the same event.AuthenticationExpiredException.AuthorizationExpired token when it is received from the server by re-authenticating (in CacheClientUpdater.processMessages or thereabouts).We need to make sure in the following scenarios, the behavior will be acceptable and shouldn't introduce any security leaks:
For on-demand re-authentication, credential expiration is discovered by the server, the client gets the notification then initiate re-authentication. Client operations will be interrupted at some period, the client will try re-authenticate only once for this operation again, hopefully the 2nd time, it will succeed.
The exception thrown by the server will be passed down to the older clients. But in order to re-authenticate automatically, users will need to use the newer-version java client.
N/A
N/A
N/A