Hi,

We would like to use the delegation service in OGSA-DAI. I am using DelegationUtil class to delegate and then retrieve credentials. Delegating credentials seems to be working fine as I get an end point reference without any errors. However, I get NoSuchResourceException when registering a listener.

I've already gone through the developer documentation,
http://www.globus.org/toolkit/docs/4.0/security/delegation/WS_AA_Delegation_Service_Public_Interfaces.html

I've also followed suggestions from this thread,
http://www-unix.globus.org/mail_archive/gt4-friends/2005/09/msg00058.html
Removing persisted objects didn't help.

The developer documentation,
http://www.globus.org/toolkit/docs/4.0/security/delegation/WS_AA_Delegation_Service_Public_Interfaces.html#domain
shows the method signature,
static X509Certificate[] getCertificateChainRP(String delegationUrl)
But I am using the jars from my Globus Toolkit library which gives me the interface, static X509Certificate[] getCertificateChainRP(EndPointReferenceType epr, ClientSecurityDescriptor desc)
So I'm not sure if this is a jar issue.

I would appreciate any suggestions on how to resolve this problem. Please find below relevant parts of my code together with container information.

Error getting delegation resource. Caused by org.globus.wsrf.NoSuchResourceException at org.globus.delegation.service.DelegationResource.load(DelegationResource.java:405) at org.globus.delegation.service.DelegationHome.find(DelegationHome.java:53) at org.globus.delegation.DelegationUtil.getDelegationResource(DelegationUtil.java:251) at org.globus.delegation.DelegationUtil.registerDelegationListener(DelegationUtil.java:156) at uk.org.ogsadai.activity.GetGSSCredentialsFromDelegationServiceActivity.registerListener(Unknown Source) at uk.org.ogsadai.activity.GetGSSCredentialsFromDelegationServiceActivity.process(Unknown Source) at uk.org.ogsadai.activity.event.EventfulActivity.process(Unknown Source) at uk.org.ogsadai.activity.concurrency.ActivityProcessingTask.call(Unknown Source) at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176) at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:431) at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:619)


import java.security.cert.X509Certificate;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.xml.namespace.QName;

import org.apache.axis.message.MessageElement;
import org.apache.axis.message.addressing.Address;
import org.apache.axis.message.addressing.EndpointReferenceType;
import org.apache.axis.message.addressing.ReferencePropertiesType;
import org.globus.delegation.DelegationConstants;
import org.globus.delegation.DelegationException;
import org.globus.delegation.DelegationUtil;
import org.globus.delegation.service.DelegationHome;
import org.globus.delegation.service.DelegationResource;
import org.globus.gsi.GlobusCredential;
import org.globus.util.I18n;
import org.globus.wsrf.ResourceException;
import org.globus.wsrf.impl.SimpleResourceKey;
import org.globus.wsrf.impl.security.authorization.HostAuthorization;
import org.globus.wsrf.impl.security.descriptor.ClientSecurityDescriptor;
import org.globus.wsrf.security.Constants;
import org.w3c.dom.Element;

public EndpointReferenceType delegateCredentials() throws Exception
{
String delegationFactoryServiceURL="https://staff-109.nesc.ed.ac.uk:8443/wsrf/services/DelegationFactoryService";; EndpointReferenceType delegationFactoryEndpoint = new EndpointReferenceType(); delegationFactoryEndpoint.setAddress(new Address(delegationFactoryServiceURL));

        GlobusCredential credential;
        credential = GlobusCredential.getDefaultCredential();

        ClientSecurityDescriptor secDesc = new ClientSecurityDescriptor();
        secDesc.setGSISecureConv(Constants.ENCRYPTION);
        secDesc.setAuthz(HostAuthorization.getInstance());

        X509Certificate[] certsToDelegateOn =
DelegationUtil.getCertificateChainRP(delegationFactoryEndpoint, secDesc);

        X509Certificate certToSign = certsToDelegateOn[0];

        String protocol = delegationFactoryEndpoint.getAddress().getScheme();
        String host     = delegationFactoryEndpoint.getAddress().getHost();
        int port        = delegationFactoryEndpoint.getAddress().getPort();
        String factoryUrl
            = protocol + "://" + host + ":" + port
            + DelegationConstants.SERVICE_BASE_PATH
            + DelegationConstants.FACTORY_PATH;

        EndpointReferenceType epr = DelegationUtil.delegate(
                factoryUrl,
                credential,
                certToSign,
                1000,
                true,
                secDesc);
        return epr;
}


public void registerListener(EndpointReferenceType epr) throws Exception
{
        ODDelegationListener listener = new ODDelegationListener();
        DelegationUtil.registerDelegationListener(epr, listener);
}

//and I am doing,
EndpointReferenceType epr = delegateCredentials();
registerListener(epr);


Globus toolkit version 4.0.7 deployed on tomcat
Tomcat version 5.5.26

I start globus as such,
globus-start-container


Kind regards,
Tilaye.

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

Reply via email to