As a follow up, I did figure out how to send the appropriate headers to RT. However, RT is caching the nonce values (this is WSSE authentication via an ATOM client) so it doesn't matter anyway. :-(

But for reference in case anyone needs it, here's what I added to RT/Client.pm. X-WSSE and Authentication are definitely required. I couldn't quickly determine if the WWW-Authenticate header is required by the spec so I sent it along anyway (after trying it both ways).

my ($username, $password) = $ua->get_basic_credentials("Support"); # This code is culled from XML::Atom::Client::munge_request(). my $nonce = XML::Atom::Client::make_nonce(); + my $nonce_enc = encode_base64($nonce, ''); + my $now = DateTime->now->iso8601 . 'Z'; + my $digest = encode_base64(sha1($nonce . $now . ($password || '')), '' +); $ua->default_header('WWW-Authenticate', 'WSSE realm="Support", profile +="UsernameToken"'); + $ua->default_header('Authorization', 'WSSE profile="UsernameToken"'); $ua->default_header('X-WSSE', sprintf + qq(UsernameToken Username="%s", PasswordDigest="%s", +Nonce="%s", Created="%s"), + $username || '', $digest, $nonce_enc, $now);

In reply to Re: Forcing LWP authentication by drewbie
in thread Forcing LWP authentication by drewbie

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.