Authenticating the user Password

This section provides an example showing the authentication script. The following example shows about authentication the default user password passw0rd .

// Fetch the user
String userId = “testuser”;
RgyUser rgyUser = null;
try {
	rgyUser = rgyRegistry.getUser(“Default”, userId);
}catch (RgyException e) {
	e.printStackTrace();
	System.exit(1);
}// Ensure the user was found
if (rgyUser == null) {
	System.out.println(“Group does not exist”);
	System.exit(1);
}try {
	rgyUser = rgyUser.authenticate(“passw0rd”.toCharArray());
}catch (RgyException e) {
	e.printStackTrace();
	System.exit(1);
}

Parent topic: Groups