Are you specifying the realm? I've been debugging the code for a while here and the problem (or my problem anyways) is this:

I specify my credentials like this:

credentials( -user => 'username', -pass => 'password', -url => 'http://localhost' )

Now, credentials get stored in a hash like this:

{ 'netloc' => { 'realm' => [ 'username', 'password' ] } }

By setting the credentials without a realm, it puts them under the default realm, so we end up with:

{ 'localhost' => { 'default' => [ 'username', 'password' ] } }

The problem is that for some reason after connecting, it discovers the realm name and decides to populate the hash above with an empty set of credentials for the realm:

{ 'localhost' => { 'default' => [ 'username', 'password' ], 'YOUR_REALM' => [ ] } }

When it goes to retrieve the credentials, it goes in this order:

{ netloc }{ realm } { default }{ realm } { netloc }{ default }

Since it entered blank credentials for the netloc+realm combination, it grabs those first. Seems like there's something wrong, it probably shouldn't be entering in the blank credentials.


In reply to Re^3: HTTP::DAV changing auth creds? by Anonymous Monk
in thread HTTP::DAV changing auth creds? by 23skiddoo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.