Pearl1594 commented on code in PR #14367:
URL: https://github.com/apache/cloudstack/pull/14367#discussion_r4221607599


##########
plugins/user-authenticators/oauth2/src/main/java/org/apache/cloudstack/oauth2/keycloak/KeycloakOAuth2Provider.java:
##########
@@ -54,13 +58,17 @@ public class KeycloakOAuth2Provider extends AdapterBase 
implements UserOAuth2Aut
 
     public static final String KEYCLOAK_PROVIDER = "keycloak";
 
-    protected String idToken = null;
-
     @Inject
     OauthProviderDao oauthProviderDao;
 
     private CloseableHttpClient httpClient;
 
+    private final Cache<String, String> validatedEmailCache =
+            Caffeine.newBuilder()
+                    .expireAfterWrite(60, TimeUnit.SECONDS)
+                    .maximumSize(1024)
+                    .build();
+

Review Comment:
   I have a question about multi-management-server setups. The UI login is two 
requests: verifyOAuthCodeAndGetUser exchanges the code and returns the email, 
then oauthlogin calls verifyUser with the same code. validatedEmailCache is an 
in-memory Caffeine cache, so it is local to one management server. Both 
requests have to land on the same MS for verifyUser to hit the cache.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to