From a28692650e00acc205d58d746e389591533adfa1 Mon Sep 17 00:00:00 2001 From: Rena Tsantouli Date: Fri, 28 Aug 2009 14:10:06 +0000 Subject: [PATCH] git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerCore@14817 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../framework/core/util/UserCredential.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/org/gcube/application/framework/core/util/UserCredential.java b/src/org/gcube/application/framework/core/util/UserCredential.java index aa08ec7..4c00aaa 100644 --- a/src/org/gcube/application/framework/core/util/UserCredential.java +++ b/src/org/gcube/application/framework/core/util/UserCredential.java @@ -2,8 +2,10 @@ package org.gcube.application.framework.core.util; import java.io.File; -import org.gcube.vomanagement.vomsAdmin.impl.VOMSAdminImpl; -import org.gcube.vomanagement.vomsClient.impl.CredentialsManagerImpl; +import org.gcube.vomanagement.vomsapi.CredentialsManager; +import org.gcube.vomanagement.vomsapi.VOMSAdmin; +import org.gcube.vomanagement.vomsapi.impl.VOMSAPIConfiguration; +import org.gcube.vomanagement.vomsapi.impl.VOMSAPIFactory; import org.gridforum.jgss.ExtendedGSSCredential; /** @@ -19,20 +21,22 @@ public class UserCredential { */ public static ExtendedGSSCredential getCredential(String username, String DLname) { - CredentialsManagerImpl man = null; + CredentialsManager man = null; try { String sharedDir = Settings.getInstance().getProperty("sharedDir"); System.out.println("file " + sharedDir + "/vomsAPI.properties exists: "+ new File(sharedDir + "/vomsAPI.properties").exists()); // man = new CredentialsManagerImpl(sharedDir + "/vomsAPI.properties"); - VOMSAdminImpl vomsAdm = new VOMSAdminImpl(sharedDir + "/vomsAPI.properties"); - man = new CredentialsManagerImpl(vomsAdm); + + VOMSAPIFactory factory = new VOMSAPIFactory(new VOMSAPIConfiguration(new File(sharedDir + "/vomsAPI.properties"))); + VOMSAdmin vomsAdm = factory.getVOMSAdmin(); + man = factory.getCredentialsManager(); } catch (Exception e1) { e1.printStackTrace(); } ExtendedGSSCredential cred = null; try { //TODO: put a real password there... - cred = man.getCredentials(username, "", DLname); + cred = man.getAttributedCredentials(username, "", DLname); } catch (Exception e) { e.printStackTrace(); }