Re: About Authenticating via StringAuthentication API from Wiki

"Mike [bondolo] Duigou" <[email protected]> Wed, 14 Sep 2005 09:27:50 -0700
Newsgroups gmane.comp.java.jxta.user
Organization Project JXTA, http://www.jxta.org
Message-ID <[email protected]>
Are you able to authenticate with the dialog authenticator using the 
same information?

Since the dialog authenticator uses the StringAuthenticator as a base 
class you might want to test authenticating with the DialogAuthenticator 
and if that works then compare the values that your code is setting with 
StringAuthenticator against the values that DialogAuthenticator uses.

Otherwise your code does look correct.

Mike

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]
> 
>