Sulman,

There is probably more than one way, but one way is to e.g. store user
credentials in an online credential repository, like MyProxy, and get
short-lived credentials from there every time you need it.

jglobus provides an API for MyProxy. Short code example:

import org.globus.myproxy.MyProxy;
...
GlobusCredential globusCred = null;
MyProxy myProxy = new MyProxy("your.myproxy.server.org", 7512);
GSSCredential credential = myProxy.get(user, password, 0);
if (GSSCredential instanceof GlobusGSSCredentialImpl) {
  globusCred = ((GlobusGSSCredentialImpl)cred).getGlobusCredential();

}
...

globusCred can then e.g. be used to secure stubs in WS invocations.

Talking of portals: You could create a login mechanism that uses the
provided username/password to fetch a credential from a MyProxy server.
If it succeeds you have 1) verified that the user provided a correct
username and password and 2) a credential of the user.
You could then e.g. store the credential in the session context and
use it whenever the portal has to act on behalf of the user.

Maybe interesting:

http://grid.ncsa.illinois.edu/myproxy/
http://grid.ncsa.illinois.edu/myproxy/portals.html

Hope that gets you started.

Martin

Muhammad Sarwar wrote:
> 
> Hi,
> 
> I am using cog-j-globus for developing a job submission client. For the
> moment it is an application but later on i would like to turn it into a
> job submission portlet. So i currently have a functioning job submission
> client but there are few things lacking in it and i dont seem to get my
> head around them. Every time when i want to submit a job to the grid i
> first have to do grid-proxy-init on the shell to create proxy
> credentials and then run the application if i dont do this application
> wont run and throws error. Can somebody point me to any example of how
> can i create the proxy credentials from within my code so that i dont
> have to do grid-proxy-init?
> 
> Sulman.
> 

Reply via email to