Skip to main content

Creating a secure Peer Group

1 reply [Last post]
raosaheb_ghuge
Offline
Joined: 2006-12-25

Hello World!!!,
Myself is working on one of the application of JXTA tecnology. I want to give log in and password to group say "XYZ". Any new peer must set the appropriate login and password before joing the group. I tried as follows
StructuredDocument creds = null;
creds=net.jxta.document.StructuredDocumentFactory.newStructuredDocument(new MimeMediaType("text/xml"),"NodeManagerLogin");

String uname=javax.swing.JOptionPane.showInputDialog(null,"Enter the username:");
creds.createElement("Username",uname);
String pwd=javax.swing.JOptionPane.showInputDialog(null,"Enter the Password:");
creds.createElement("Password",pwd);

// Generate the credentials for the Peer Group
AuthenticationCredential authCred =
new AuthenticationCredential( tpGroup, null, creds );

// Get the MembershipService from the peer group
MembershipService membership = tpGroup.getMembershipService();

// Get the Authenticator from the Authentication creds
Authenticator auth = membership.apply( authCred );

// Check if everything is okay to join the group
if (auth.isReadyForJoin())
{
Credential myCred = membership.join(auth);
but when i run this twise it does not one with wrong username and password it does not display error

Please help.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
benus_ying
Offline
Joined: 2007-08-10

i have the some question,any one knows how to implement it?
3x lot.