code: @SuppressWarnings("restriction")
  	public static void mountOrientDbRestApi(OrientDBHttpAPIResource resource, WebApplication app, String... mountPaths)
  	{
  		app.getSharedResources().add(ORIENT_DB_KEY, resource);
  		Authenticator.setDefault(new Authenticator() {
  			@Override
  			protected PasswordAuthentication getPasswordAuthentication() {
  				String username;
  				String password;
  				OrientDbWebSession session = OrientDbWebSession.get();
  				if(session.isSignedIn())
  				{
  					username = session.getUsername();
  					password = session.getPassword();
  				}
  				else
  				{
  					IOrientDbSettings settings = OrientDbWebApplication.get().getOrientDbSettings();
  					username = settings.getGuestUserName();
  					password = settings.getGuestPassword();
  				}
  				return new PasswordAuthentication (username, password.toCharArray());
  			}
  			
  		});
  		 CookieHandler.setDefault(new PersonalCookieManager());
  		 sun.net.www.protocol.http.AuthCacheValue.setAuthCache(new MultiUserCache());
  		 for (String mountPath : mountPaths) {
  			 app.mountResource(mountPath, new SharedResourceReference(ORIENT_DB_KEY));
  		}
  	}
docs: Mounts OrientDB REST API Bridge to an app
  @param resource {@link OrientDBHttpAPIResource} to mount
  @param app {@link WebApplication} to mount to
  @param mountPaths array of paths to mount to