diff --git a/src/org/gcube/application/framework/core/cache/factories/ApplicationCredentials.java b/src/org/gcube/application/framework/core/cache/factories/ApplicationCredentials.java index 9654032..e29ae5c 100644 --- a/src/org/gcube/application/framework/core/cache/factories/ApplicationCredentials.java +++ b/src/org/gcube/application/framework/core/cache/factories/ApplicationCredentials.java @@ -8,7 +8,9 @@ import org.gcube.application.framework.core.util.UserCredential; import org.gcube.common.core.scope.GCUBEScope; import org.gcube.common.core.security.utils.VOMSAttributesReader; import org.gcube.common.core.utils.logging.GCUBELog; -import org.gcube.vomanagement.vomsAdmin.impl.VOMSAdminImpl; +import org.gcube.vomanagement.vomsapi.VOMSAdmin; +import org.gcube.vomanagement.vomsapi.impl.VOMSAPIFactory; +import org.glite.wsdl.services.org_glite_security_voms.User; import org.gridforum.jgss.ExtendedGSSCredential; /** @@ -54,23 +56,33 @@ public class ApplicationCredentials { ExtendedGSSCredential cred = creds.get(VREname); if(cred == null) { - // If the creedential is not available, it retrieves it from myProxy + // If the credential is not available, it retrieves it from myProxy cred = UserCredential.getCredential("application", VREname); if(cred == null) { //user "application" does not exist on this VRE, so we add him and try to get credential again - VOMSAdminImpl vomsA; + VOMSAdmin vomsA; + VOMSAPIFactory factory; try { - vomsA = VOMSAdminManager.getVOMSAdmin(); + factory = VOMSAdminManager.getVOMSFactory(); + vomsA = factory.getVOMSAdmin(); // String[] roles = vomsA.listRoles(); // vomsA.createUser("application", userDN+"application", userCA, "application@gcube.org"); // vomsA.addMember(VREname, userDN+"application", userCA); // vomsA.assignRole(VREname, roles[0], userDN+"application", userCA); // vomsA = new VOMSAdminImpl(); - String[] roles = vomsA.getPortType().listRoles(); - vomsA.getExtendedPortType().createUser("application", userDN+"application", userCA, "application@gcube.org"); - vomsA.getExtendedPortType().addOnlineCAMember(VREname, userDN+"application"); - vomsA.getExtendedPortType().assignOnlineCARole(VREname, roles[0], userDN+"application"); + String[] roles = vomsA.listRoles(); + User myUser = new User(); + myUser.setCN("application"); + myUser.setDN(userDN+"application"); + myUser.setCA(userCA); + myUser.setMail("application@gcube.org"); + //vomsA.getExtendedPortType().createUser("application", userDN+"application", userCA, "application@gcube.org"); + vomsA.createUser(myUser); + //vomsA.getExtendedPortType().addOnlineCAMember(VREname, userDN+"application"); + //vomsA.getExtendedPortType().assignOnlineCARole(VREname, roles[0], userDN+"application"); + vomsA.addMember(VREname, userDN + "application", userCA); + vomsA.assignRole(VREname, roles[0], userDN + "application", userCA); } catch (Exception e) { vomsA = null;