use of org.keycloak.models.UserCredentialManager in project keycloak by keycloak.
the class WebAuthnDataWrapper method init.
private void init() {
final UserModel user = session.users().getUserByUsername(session.getContext().getRealm(), username);
if (user == null)
return;
final UserCredentialManager userCredentialManager = session.userCredentialManager();
if (userCredentialManager == null)
return;
final CredentialModel credential = userCredentialManager.getStoredCredentialsByTypeStream(session.getContext().getRealm(), user, credentialType).findFirst().orElse(null);
if (credential == null)
return;
this.webAuthnData = createFromCredentialModel(credential).getWebAuthnCredentialData();
}
Aggregations