Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
AW: AW: [geclipse-dev] Token creation

> The code:
> 
>             VomsProxyDescription desc = new VomsProxyDescription(
>                     new IVirtualOrganization[] { biomed },
>                     new File("/home/reuillon/.globus/usercert.pem"),
>                     new File("/home/reuillon/.globus/userkey.pem")
>              );
> 
>             AuthTokenRequest request = new AuthTokenRequest( desc,
"This 
> is me", "I need a VOMS proxy" );
>             IAuthenticationToken token = 
> AbstractAuthTokenProvider.staticRequestToken( request );
>
>
>        //    AuthenticationTokenManager authManager = 
> AuthenticationTokenManager.getManager();
>             VomsProxy proxy = ( VomsProxy ) desc.createToken(  );
> 
> 
>             if ( ! proxy.isValid() ) {
>                 proxy.validate( null );
>             }
>             if ( ! proxy.isActive() ) {
>                proxy.setActive( true, null );
>             }

If you nevertheless create your token with desc.createToken() you can
just skip the AbstractAuthTokenProvider.staticRequestToken() that causes
the exception:

VomsProxyDescription desc = new VomsProxyDescription(
                    new IVirtualOrganization[] { biomed },
                    new File("/home/reuillon/.globus/usercert.pem"),
                    new File("/home/reuillon/.globus/userkey.pem")
             );
VomsProxy proxy = ( VomsProxy ) desc.createToken(  );
if ( ! proxy.isValid() ) {
  proxy.validate( null );
}
if ( ! proxy.isActive() ) {
  proxy.setActive( true, null );
}

Should work in any case ... hopefully ;-)

Mathias


Back to the top