lasdf1234 commented on issue #11781: URL: https://github.com/apache/gravitino/issues/11781#issuecomment-4794907159
> 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) After conducting further research, I discovered that the reason for the slow performance of group authentication does not lie in the call to the 'authenticate' method. Both user authentication and group authentication involve calling this method. -- 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]
