currentAuthentication to get Firstname ,Lastname

Hi,
I am trying to get Firstname and lastname of user by using currentAuthentication but since it extends UserDetails it is not possible to get these values.
Is there any other way to fetch details

User user = (User) currentAuthentication.getUser();
user.getFirstName();
user.getLastName();

2 Likes