If client app did delegate to Service A, you need to see where the delegated 
credential is stored and use that for Service A call.

Your question is how the client app can get the user credential: that depends 
on where it is running and whether it has access to user's certificate or proxy 
certificate. 

The code you provided is something that can only be used on a service that is 
implemented on the Java WS core stack. If you are looking to find the delegated 
credential on the Service A, then this code should help. But from your error 
message it appears that the subject is not a delegated credential. How did you 
delegate from client to Service A?

Rachana

On Jan 19, 2011, at 7:38 PM, Alisson Wilker wrote:

> Hi, I have a simple problem that's driving me crazy. Maybe you could help me.
> 
> a client application should contact service A that should then contact 
> service B. However, when A calls service B it does it with host credentials, 
> not with the user credentials A received from the client app. I've tried to 
> delegate credentials, but how can I get user credentials on my client app? 
> The client app is not a globus service, so I can't make:
> 
>               Subject subject = 
> (Subject)MessageContext.getCurrentContext().getProperty(org.globus.wsrf.impl.security.authentication.Constants.PEER_SUBJECT);
>               GlobusCredential credential = null;
>               if( (GlobusGSSCredentialImpl)JaasGssUtil.getCredential(subject) 
> == null )
>                       throw new Exception("No Credentials associated with 
> subject "+subject);
>               credential = 
> ((GlobusGSSCredentialImpl)JaasGssUtil.getCredential(subject)).getGlobusCredential();
> 
> If I do so, it will throw me the exception: "No Credentials associated with 
> subject ".
> 
> I think it has a simple solution, but it's driving me crazy. Need your help 
> please.
> 
> Thanks in advance.
> 
> -- 
> []s
> Alisson Wilker
> 
> "The success depends on three elements: courage, knowledge and opportunity. 
> Therefore, be bold and get ready. Because the opportunity... that will come!" 
> (Alisson Wilker)
> 
> "Success is being able to do and know things that just a few people around 
> you did or knew by means of your responsible effort." (Alisson Wilker)
> 
>   
> 

Rachana Ananthakrishnan
Argonne National Lab | University of Chicago

Reply via email to