roryqi commented on code in PR #11226:
URL: https://github.com/apache/gravitino/pull/11226#discussion_r3311364207


##########
plugins/idp-basic/src/main/java/org/apache/gravitino/idp/IdpUserGroupManager.java:
##########
@@ -100,13 +151,27 @@ public IdpUser getUser(String username) {
     return new IdpUser(userPO.getUsername(), 
USER_SERVICE.listGroupNamesByUsername(username));
   }
 
+  public IdpUser authenticate(String username, String password) {
+    try {
+      IdpUserPO userPO = USER_SERVICE.getIdpUserByUsername(username);
+      if (!passwordHasher.verify(password, userPO.getPasswordHash())) {
+        throw new UnauthorizedException(
+            "Invalid username or password", 
AuthConstants.AUTHORIZATION_BASIC_HEADER.trim());
+      }
+      return new IdpUser(username, 
USER_SERVICE.listGroupNamesByUsername(username));

Review Comment:
   Twice IO operations. Can u use once IO operation?



-- 
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