lasdf1234 commented on issue #11781:
URL: https://github.com/apache/gravitino/issues/11781#issuecomment-4786918225

   > The difference is that, compared to user authorization, group 
authorization has the following extra steps, which will query database:
   > 
   > 
[gravitino/plugins/idp-basic/src/main/java/org/apache/gravitino/idp/auth/BasicAuthenticator.java](https://github.com/apache/gravitino/blob/d845d5cddc5bc208968a0e6bf4b594691afdb853/plugins/idp-basic/src/main/java/org/apache/gravitino/idp/auth/BasicAuthenticator.java#L147-L155)
   > 
   > Lines 147 to 155 in 
[d845d5c](/apache/gravitino/commit/d845d5cddc5bc208968a0e6bf4b594691afdb853)
   > 
   >  private UserPrincipal authenticate(BasicCredentials credentials, String 
authData) { 
   >    IdpUser user = userGroupManager.authenticate(credentials.username(), 
credentials.password()); 
   >   
   >    List<UserGroup> groups = 
   >        user.groupNames().stream() 
   >            .map(groupName -> new UserGroup(Optional.empty(), groupName)) 
   >            .collect(Collectors.toList()); 
   >    return new UserPrincipal(user.name(), groups, authData); 
   >  } 
   > We need to use a cache to avoid repeatedly accessing database.
   > 
   > cc [@lasdf1234](https://github.com/lasdf1234)
   
   Got I'll do some research.


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