Re: About Authenticating via StringAuthentication API from Wiki

James Todd <[email protected]> Wed, 14 Sep 2005 08:15:42 -0700
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
Hi Joan -

  Has your application authenticated itself?

  MyJXTA also implements StringAuthenticator and as such can be referenced.

  hth,

- james

--

James Todd :: blogs.sun.com/gonzo | weblogs.java.net/blog/gonzo

MyJXTA :: use it - learn it - do it

Java == platform independence
XML  == application independence
JXTA == network independence

Secure End-to-End Computing 



Joan Esteve wrote:

> Hello, jxta users!
>
> I'm trying to implement the Password Topic authentication from my jxta 
> nodes. I followed the instructions posted at:
>
> http://wiki.java.net/bin/view/Jxta/PasswordTopic
>
> The sample about "InteractiveAuthentication" works fine in my network. 
> The problems begin when i try to implement the "StringAuthentication" 
> method. I have configured the following node using extended 
> configuration (net.jxta.ext.config):
>
>    String username="node1";
>    String password="helloworld";
>    Configurator config = new Configurator( username,"My Share 
> Project", password,  password );      ...
>    config.save();
>
> The PlatformConfig is correctly created. After this, the code used to 
> implement the StringAuthentication is the following one:
>
>    PeerGroup p = PeerGroupFactory.newNetPeerGroup();
>    MembershipService membership = p.getMembershipService();
>    Credential cred = membership.getDefaultCredential();
>     if( null == cred ) {
>        AuthenticationCredential authCred = new 
> AuthenticationCredential( p, "StringAuthentication", null );
>        StringAuthenticator auth = (StringAuthenticator) 
> membership.apply( authCred );
>    }
>    if( null != auth ) {
>        auth.setAuth1_KeyStorePassword( "helloworld".toCharArray() );
>        auth.setAuth2Identity( p.getPeerID() );
>        auth.setAuth3_IdentityPassword( "helloworld".toCharArray() );
>        if( auth.isReadyForJoin() ) {
>            membership.join( auth ); <---- i never reach this branch!!!
>        }else{
>            System.out.println("NOT READY!!"); <--- always! :(
>        }
>    }
> }
>
> Where is exactly my mistake in this procedure? Thanks in advance to 
> anyone who can help me
>
> Joan Esteve
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>