Page tree
Skip to end of metadata
Go to start of metadata

You can configure jUDDI to use one of the three Authentication modules supplied or you can write your own Authenticator that integrates jUDDI with your organizations authentication mechanism. All you have to do to create your own Authenticator is create a class that implements the org.apache.juddi.auth.Authenticator interface.

Below is an example of a custom Authenticator that successfully authenticates any user who specifies a password of steve.

	package net.viens.juddi.auth;

	import org.apache.juddi.auth.Authenticator;
	import org.apache.juddi.error.RegistryException;
	import org.apache.juddi.error.UnknownUserException;

	 * This is a sample implementation of jUDDI's Authenticator 
	 * interface.
	public class MyCoolAuthenticator implements Authenticator
	  public String authenticate(String userID,String credential)
	    throws RegistryException
	    if (credential.equals("steve"))
	      return userID;
	    throw new UnknownUserException("The userID specified is unknown.");

IMPORTANT: If you take a look at the return value you'll notice that the userID parameter value passed in is being returned. This is important to do this becauase jUDDI uses this value as a key to fetch and maintain information about the account associated with the user.

Once you've created your Authenticator you'll need to place it in the webapps classpath. One common way to do this is to place it in the WEB-INF/classes directory (remember to place it in a directory structure that matches your package name). Also, make sure any classes or jar files that your authenticator is dependent on are accessable by the jUDDI web application (either in WEB-INF/classes, WEB-INF/lib).

Now you've got to instruct jUDDI to use your new authenticator. This is done by simply setting the juddi.auth property in jUDDI's property file ("") to the fully qualified class name of your Authenticator. The file is located in the WEB-INF directory. Take a quick glance through the file to be sure that the juddi.auth property isn't already set - if it is then either replace the class name with yours or remove/comment-out the line.

    juddi.auth = net.viens.juddi.auth.MyCoolAuthenticator

That's it. You will need to restart the jUDDI web application for this change to take effect.

Window size: x Viewport size: x

  • No labels