// Sanity check
Preconditions.checkNotNull(credentials);
Preconditions.checkNotNull(credentials.getUsername());
Preconditions.checkNotNull(credentials.getPasswordDigest());
WebFormAuthenticationDto entity = new WebFormAuthenticationDto(
credentials.getUsername(),
credentials.getPasswordDigest()
);
// TODO Replace "magic string" with auto-discover based on link rel