use of com.webauthn4j.springframework.security.webauthn.sample.app.api.ProfileForm in project webauthn4j-spring-security by webauthn4j.
the class AppSpecificMapper method mapToProfileForm.
public ProfileForm mapToProfileForm(UserEntity userEntity) {
ProfileForm profileForm = new ProfileForm();
profileForm.setId(userEntity.getId());
profileForm.setUserHandle(mapToBase64Url(userEntity.getUserHandle()));
profileForm.setFirstName(userEntity.getFirstName());
profileForm.setLastName(userEntity.getLastName());
profileForm.setEmailAddress(userEntity.getEmailAddress());
// authenticators
profileForm.setAuthenticators(new ArrayList<>());
mapToAuthenticatorFormList(userEntity.getAuthenticators(), profileForm.getAuthenticators());
profileForm.setSingleFactorAuthenticationAllowed(userEntity.getAuthorities().stream().anyMatch(authorityEntity -> authorityEntity.getAuthority().equals("SINGLE_FACTOR_AUTHN_ALLOWED")));
return profileForm;
}
Aggregations