Index: ivy.xml
===================================================================
--- ivy.xml	(revision 1482980)
+++ ivy.xml	(working copy)
@@ -49,7 +49,10 @@
 		<dependency org="commons-httpclient" name="commons-httpclient" rev="3.0" conf="default,httpclient->runtime,master" />
 		<dependency org="oro" name="oro" rev="2.0.8" conf="default,oro->default"/>
 		<dependency org="commons-vfs" name="commons-vfs" rev="1.0" conf="default,vfs->default" />
-		<dependency org="com.jcraft" name="jsch" rev="0.1.31" conf="default,sftp->default" />
+		<dependency org="com.jcraft" name="jsch" rev="0.1.50" conf="default,sftp->default" />
+		<dependency org="com.jcraft" name="jsch.agentproxy" rev="0.0.6" conf="default,sftp->default" />
+		<dependency org="com.jcraft" name="jsch.agentproxy.connector-factory" rev="0.0.6" conf="default,sftp->default" />
+		<dependency org="com.jcraft" name="jsch.agentproxy.jsch" rev="0.0.6" conf="default,sftp->default" />
 		<dependency org="org.bouncycastle" name="bcpg-jdk14" rev="1.45" conf="default" />
         <dependency org="org.bouncycastle" name="bcprov-jdk14" rev="1.45" conf="default" />
 
Index: src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java
===================================================================
--- src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java	(revision 1482980)
+++ src/java/org/apache/ivy/plugins/resolver/AbstractSshBasedResolver.java	(working copy)
@@ -56,6 +56,16 @@
     }
 
     /**
+     * Determines whether a local SSH agent may be used for authentication
+     *
+     * @param allowedAgentUse
+     *            true if an agent may be used if available
+     */
+    public void setAllowedAgentUse(boolean allowedAgentUse) {
+        getSshBasedRepository().setAllowedAgentUse(allowedAgentUse);
+    }
+
+    /**
      * Optional password file. If set the repository will use it as an encypted property file, to
      * load username and passwd entries, and to store them if the user choose to do so. Defaults to
      * user.dir/.ivy/[host].sftp.passwd, set it to null to disable this feature.
Index: src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java
===================================================================
--- src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java	(revision 1482980)
+++ src/java/org/apache/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java	(working copy)
@@ -47,6 +47,8 @@
 
     private int port = -1;
 
+    private boolean allowedAgentUse = false;
+
     public AbstractSshBasedRepository() {
         super();
     }
@@ -106,7 +108,7 @@
              }
         }
         return SshCache.getInstance().getSession(host, port, user, userPassword, getKeyFile(),
-            getKeyFilePassword(), getPassFile());
+            getKeyFilePassword(), getPassFile(), isAllowedAgentUse());
     }
 
     /**
@@ -299,6 +301,22 @@
         return passFile;
     }
 
+    /**
+     * @return
+     * 	          Whether use of a local SSH agent for authentication is allowed
+     */
+    public boolean isAllowedAgentUse() {
+        return allowedAgentUse;
+    }
+
+    /**
+     * @param allowedAgentUse
+     * 	          Whether use of a local SSH agent for authentication is allowed
+     */
+    public void setAllowedAgentUse(boolean allowedAgentUse) {
+        this.allowedAgentUse = allowedAgentUse;
+    }
+
     protected abstract String getRepositoryScheme();
 
 }
Index: src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java
===================================================================
--- src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java	(revision 1482980)
+++ src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java	(working copy)
@@ -17,13 +17,8 @@
  */
 package org.apache.ivy.plugins.repository.ssh;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Properties;
-
+import com.jcraft.jsch.*;
+import com.jcraft.jsch.agentproxy.*;
 import org.apache.ivy.core.IvyContext;
 import org.apache.ivy.core.event.IvyEvent;
 import org.apache.ivy.core.event.IvyListener;
@@ -33,12 +28,12 @@
 import org.apache.ivy.util.CredentialsUtil;
 import org.apache.ivy.util.Message;
 
-import com.jcraft.jsch.ChannelSftp;
-import com.jcraft.jsch.JSch;
-import com.jcraft.jsch.JSchException;
-import com.jcraft.jsch.Session;
-import com.jcraft.jsch.UIKeyboardInteractive;
-import com.jcraft.jsch.UserInfo;
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Properties;
 
 /**
  * a class to cache SSH Connections and Channel for the SSH Repository each session is defined by
@@ -106,7 +101,7 @@
         /**
          * attach an sftp channel to this cache entry
          * 
-         * @param channelSftp
+         * @param newChannel
          *            to attach
          */
         public void setChannelSftp(ChannelSftp newChannel) {
@@ -287,6 +282,25 @@
     }
 
     /**
+     * Attempts to connect to a local SSH agent (using either UNIX sockets or PuTTY's Pageant)
+     *
+     * @param jsch
+     *          Connection to be attached to an available local agent
+     * @return
+     *          true if connected to agent, false otherwise
+     */
+    private boolean attemptAgentUse(JSch jsch) {
+        try {
+            Connector con = ConnectorFactory.getDefault().createConnector();
+            jsch.setIdentityRepository(new RemoteIdentityRepository(con));
+            return true;
+        } catch(AgentProxyException e) {
+            Message.verbose(":: SSH :: Failure connecting to agent :: " + e.toString());
+            return false;
+        }
+    }
+
+    /**
      * Gets a session from the cache or establishes a new session if necessary
      * 
      * @param host
@@ -303,10 +317,12 @@
      *            to use for accessing the pemFile (optional)
      * @param passFile
      *            to store credentials
+     * @param allowedAgentUse
+     *            Whether to communicate with an agent for authentication
      * @return session or null if not successful
      */
     public Session getSession(String host, int port, String username, String userPassword,
-            File pemFile, String pemPassword, File passFile) throws IOException {
+            File pemFile, String pemPassword, File passFile, boolean allowedAgentUse) throws IOException {
         Checks.checkNotNull(host, "host");
         Checks.checkNotNull(username, "user");
         Entry entry = getCacheEntry(username, host, port);
@@ -323,6 +339,9 @@
                 } else {
                     session = jsch.getSession(username, host);
                 }
+                if (allowedAgentUse) {
+                    attemptAgentUse(jsch);
+                }
                 if (pemFile != null) {
                     jsch.addIdentity(pemFile.getAbsolutePath(), pemPassword);
                 }
