use of org.orcid.core.security.OrcidWebRole in project ORCID-Source by ORCID.
the class ManageProfileControllerTest method getAuthentication.
protected Authentication getAuthentication(String orcid) {
List<OrcidWebRole> roles = Arrays.asList(OrcidWebRole.ROLE_USER);
OrcidProfileUserDetails details = new OrcidProfileUserDetails(orcid, "user_1@test.orcid.org", null, roles);
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(orcid, null, roles);
auth.setDetails(details);
return auth;
}
use of org.orcid.core.security.OrcidWebRole in project ORCID-Source by ORCID.
the class AdminControllerTest method getAuthentication.
@Override
protected Authentication getAuthentication() {
orcidProfile = orcidProfileManager.retrieveOrcidProfile("4444-4444-4444-4440");
List<OrcidWebRole> roles = getRole();
OrcidProfileUserDetails details = new OrcidProfileUserDetails(orcidProfile.retrieveOrcidPath(), orcidProfile.getOrcidBio().getContactDetails().retrievePrimaryEmail().getValue(), null, roles);
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(orcidProfile.retrieveOrcidPath(), orcidProfile.getPassword(), getRole());
auth.setDetails(details);
return auth;
}
use of org.orcid.core.security.OrcidWebRole in project ORCID-Source by ORCID.
the class ManageMembersControllerTest method getAuthentication.
protected Authentication getAuthentication() {
List<OrcidWebRole> roles = Arrays.asList(OrcidWebRole.ROLE_GROUP);
OrcidProfileUserDetails details = new OrcidProfileUserDetails("5555-5555-5555-0000", "premium_institution@group.com", "", roles);
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(details, "5555-5555-5555-0000", roles);
return auth;
}
use of org.orcid.core.security.OrcidWebRole in project ORCID-Source by ORCID.
the class FundingsControllerTest method getAuthentication.
@Override
protected Authentication getAuthentication() {
orcidProfile = orcidProfileManager.retrieveOrcidProfile("4444-4444-4444-4443");
List<OrcidWebRole> roles = Arrays.asList(OrcidWebRole.ROLE_USER);
OrcidProfileUserDetails details = new OrcidProfileUserDetails(orcidProfile.retrieveOrcidPath(), orcidProfile.getOrcidBio().getContactDetails().retrievePrimaryEmail().getValue(), null, roles);
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken("4444-4444-4444-4443", details.getPassword(), roles);
auth.setDetails(details);
return auth;
}
use of org.orcid.core.security.OrcidWebRole in project ORCID-Source by ORCID.
the class GetMyDataControllerTest method getAuthentication.
private Authentication getAuthentication() {
List<OrcidWebRole> roles = Arrays.asList(OrcidWebRole.ROLE_USER);
OrcidProfileUserDetails details = new OrcidProfileUserDetails(ORCID, "user_1@test.orcid.org", null, roles);
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(ORCID, null, roles);
auth.setDetails(details);
return auth;
}
Aggregations