git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerCore@14817 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b2e03278d6
commit
a28692650e
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue