Authentication etc.

Demetris G <[email protected]> Mon, 25 Jul 2005 19:04:00 -0400
Newsgroups gmane.comp.java.jxta.user,gmane.comp.java.jxta.devel
Message-ID <[email protected]>
Can someone help out with this one ? What would make the credentials not 
be null in a new group ? TVMIA

        AuthenticationCredential authcred = null ;
        MembershipService memberserv = null ;
        StringAuthenticator authenticator = null ;
        Credential credentials = null ;

        try {

            memberserv = JPPeerGroup.getMembershipService();
            if ( ( credentials = memberserv.getDefaultCredential() ) == 
null ) {
                    authcred = new AuthenticationCredential(JPPeerGroup, 
"StringAuthentication", null);
                    authenticator = (StringAuthenticator) 
memberserv.apply( authcred ) ;

                    if ( authenticator != null ) {
                        authenticator.setAuth1_KeyStorePassword( 
keypassword.toCharArray() );
                        authenticator.setAuth2Identity( 
JPPeerGroup.getPeerID() );
                        authenticator.setAuth3_IdentityPassword( 
idpassword.toCharArray() );

                        if (authenticator.isReadyForJoin()) {
                            memberserv.join(authenticator);
                        }
                    }
            }