if (authRequest.getCredential() != null) {
CredentialType credentialType = authRequest.getCredential().getValue();
credentials = (PasswordCredentialsRequiredUsername) credentialType;
} else {
credentials = new PasswordCredentialsRequiredUsername();
<BUG>credentials.setUsername(authRequest.getTenantId());
credentials.setPassword(authRequest.getToken().getId());
if (!p.isValidToken(credentials.getPassword())) {
return Response.status(Response.Status.NOT_FOUND).entity(wrapper.wrapElement(p.createItemNotFound())).build();
}
String userName = p.getUsernameFromToken(credentials.getPassword());
if (!StringUtilities.nullSafeEqualsIgnoreCase(userName, credentials.getUsername())) {
return Response.status(Response.Status.NOT_FOUND).entity(wrapper.wrapElement(p.createItemNotFound())).build();
}</BUG>
}

if (authRequest.getCredential() != null) {
CredentialType credentialType = authRequest.getCredential().getValue();
credentials = (PasswordCredentialsRequiredUsername) credentialType;
} else {
credentials = new PasswordCredentialsRequiredUsername();
credentials.setUsername(authRequest.getTenantId());
credentials.setPassword("someKey");
}
