• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item6409: Request Perl code sample to invoke TWiki URL using HTTPS/SSL and handle the username/password prompt?

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension PublishContrib, viewfile Normal No Action Required   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

-- TWiki:Main/KitLueder - 23 Mar 2010

Does anyone please have a working Perl code example of calling the twiki URL, using https/ssl, with support for the twiki's username/password prompt?

Hi. I am trying to invoke a module 'viewfile" from my perl program. The twiki is configured to use https (SSL), so I have to use the "LWP::UserAgent" rather than the simpler "HTTP::Request". Regardless of how I set the credentials, it has no effect. I don't get past the username/password prompt.

I tried to add this to the end of the request URL, but it had no effect: ;authorization='base64EncodingOfUsernamePassword'

(I am using the latest ActivePerl, version 1007, which corresponds to Perl version 5.10.1.

I am running on a pc with Windows NT.)

Here is the Perl code I am using (sanitized):

use LWP::UserAgent;

use LWP 5.66;

my $browser = LWP::UserAgent->new;

# this doesn't have any effect:

$browser->credentials(

'hostname.com:443',

'MyRealm',

'KitLueder' => 'password'

);

my $url = "https://hostname.com/twiki/bin/EtcEtcEtc";

my $response = $browser->get($url);

die "Error at $url\n ", $response->status_line, "\n Aborting"

unless $response->is_success;

print "Whee, it worked! I got that ",

$response->content_type, " document!\n";

# I then want to use this to download the resulting file, but it just obtains the username/password prompt screen:

my $datafile = "Filename.doc";

use HTTP::Request::Common;

$response = $browser->request( GET($url), $datafile );

exit;

By the way, the twiki "LocalSite.cfg" file had a strange configuration for AuthRealm, a value of the following: 'Enter your LoginName. (Typically First name and last name, no space, no dots, capitalized, e.g. JohnSmith, unless you chose otherwise). Visit TWikiRegistration if you do not have one.'

To summarize the questions:

1. Request for code example to access twiki using https/ssl, to get past the username/password prompt.

2. Recommendations for how to do the basic authentication credentials, given that we are accessing via ssl.

3. Suggestions of changes

4. How do I query what the host domain and realm are?

5. Does twiki ignore that AuthRealm setting?

Thanks

Kit Lueder

cell 703-577-2463

clueder@aagNOSPAM.dese.com

-- TWiki:Main.KitLueder - 23 Mar 2010

This is best handled as a support question at TWiki:Support/WebHome.

-- TWiki:Main.PeterThoeny - 23 Mar 2010

ItemTemplate
Summary Request Perl code sample to invoke TWiki URL using HTTPS/SSL and handle the username/password prompt?
ReportedBy TWiki:Main.KitLueder
Codebase 4.3.1, 4.3.2
SVN Range TWiki-5.0.0, Fri, 19 Mar 2010, build 18391
AppliesTo Extension
Component PublishContrib, viewfile
Priority Normal
CurrentState No Action Required
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2010-03-23 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback