You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by William Ferguson <wi...@hubbub.com.au> on 2005/06/02 06:56:47 UTC
Authentication
OK, I'm lost, I'll admit it.
If I already know the username for an SVN_RA client (ie they have already
been authenticated by a previous layer), and I just want to inform SVN that
the caller for the current RA session is userX, how do I do it?
This is what I have so far:
-------------------------------------------------
// pack the providers into an array
apr_array_header_t *providers;
// add provider - probably just need one simple one that reads the usernmae
form the params perhaps?
.. code ommitted
// get the auth_baton
svn_auth_open(&authBaton, providers, pool);
// pass in the known username for this session.
svn_aut_set_parameter(authBaton, "someUserNameKey" /* perhaps
SVN_AUTH_PARAM_DEFAULT_USERNAME */, username);
-------------------------------------------------
The above compiles OK, and even works when the server is configured as
anon-access = write
// auth-access = write
Ie no authentication, although my providers aren't called.
But as soon as I copnfigugre the server as:
anon-access = none
auth-access = write
svn_ra_open fails with : "No access allowed to this Repository"
What should I do to pass the userName into SubVersion (so it annotates each
commit etc)?
Oh, and go slow, I'm a Java, not a C developer :-)
William
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Authentication
Posted by Ben Collins-Sussman <su...@collab.net>.
On Jun 2, 2005, at 1:56 AM, William Ferguson wrote:
> // pack the providers into an array
> apr_array_header_t *providers;
> // add provider - probably just need one simple one that reads the
> usernmae
> form the params perhaps?
That's the problem. You've installed only 1 provider, the one which
sucks the {username, password} credential structure from the
parameter hash. So when the server challenges the client, the client
asks this one provider, which returns {username, NULL} -- because
there's no SVN_AUTH_PARAM_DEFAULT_PASSWORD sitting in the parameter
hash. And you get failure.
If you were to add other providers -- like ones that pull credentials
from the disk cache, or ones that prompt the user, then the client
would have more options for digging up the password.
Remember, the username doesn't exist in a vacuum. The server and
client operate on a {username, password} *pair*.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org