In a Keycloak 24 custom extension I add the next code to create ned OTP credential:
UserCredentialModel credentials = new UserCredentialModel();
credentials.setType(CredentialModel.OTP);
credentials.setValue(secondFactorSecret);
user.credentialManager().updateCredential(credentials);
Now, I cannot see “subType: totp” in the database , field “credential.credential_data”