private AuthenticatedUser toAuthenticationV2(DomainData domain, ProjectSpec projectSpec,
UserWithSecret userWithSecret) throws CloudException {
ProjectData project = null;
ProjectRoles projectRoles = null;
UserData user = userWithSecret.getUserData();
if (projectSpec.projectId != 0) {
return buildProjectToken(domain, projectSpec.projectId, userWithSecret);
} else if (!Strings.isNullOrEmpty(projectSpec.projectName)) {
for (ProjectRoles i : user.getProjectRolesList()) {
ProjectData p = authRepository.getProjects().find(i.getProject());
if (p == null) {
continue;
}