Authentication with Perl bindings
From: Giulio Troccoli <Giulio.Troccoli_at_uk.linedata.com>
Date: Tue, 8 Dec 2009 11:18:19 +0000
I'm desperately trying to write something in Perl to authenticate.
The functionality I want to reproduce is:
This is what the SVN client does, I think. But I'm not able to do it in Perl. I'm using the following code, which I found in the perldoc for SVN::Client
use SVN::Client;
sub simple_prompt {
print "Enter authentication info for realm: $realm\n";
(I know the password is in clear, but I can fix that later).
If the username and password are cached this works perfectly well. When I comment out the get_simple_provider line (to simulate authentication data not being cached) I am asked for a username and password. If I enter the correct ones everything works. Otherwise I am asked two more times, and eventually the authentication fails.
So, my questions are:
1) What is get_username_provider used for? When would I want to get the chached username only?
2) How can I implement my second point "ask for a password for the current username" ? I have tried changing simple_prompt as follows
print "Enter authentication info for realm: $realm\n";
And it works if I enter the correct password the first time. But if the password is wrong, not only I'm not asked again but I get a "Memory fault" error. I wasn't really expecting to be asked for the username but at least for the password for two more times.
Anyone has done what I'm trying to do already? Anyone has any hints or suggestions?
Thanks in advance
P.S. I post this email to both mailing list @tigris and @apache, just becuase the apache one doesn't seem to be very active.
Linedata Services (UK) Ltd
|
This is an archived mail posted to the Subversion Users mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.