Re: About Authenticating via StringAuthentication API from Wiki

James Todd <[email protected]> Wed, 14 Sep 2005 12:40:50 -0700
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
Whoops. I got a little ahead of myself on my first response. My bad.

Here's the "String Authentication" logic that is used by MyJXTA:

  
http://myjxta2.jxta.org/source/browse/myjxta2/src/net/jxta/myjxta/util/AuthenticationUtil.java

The only difference I see is that MyJXTA uses the MembershipService 
housed w/in the
TLS Transport group to authenticate against, vs the current PeerGroup. I 
ran into the
need to do this when MyJXTA offered "deferred authentication" which can 
imply one can
join subgroups before authenticating.

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



Mike [bondolo] Duigou wrote:

> 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]
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>