For When You Can't Have The Real Thing
[ start | index | login ]
start > perl > Authorization Basic Generation

Authorization Basic Generation

Created by dave. Last edited by dave, 4 years and 240 days ago. Viewed 1,346 times. #1
[edit] [rdf]


How do I generate a Basic Authorization header for use in my html?


$ echo -n myuser:mypassword | base64

Implemented as so:

my $http = HTTP::Tiny->new(
    default_headers => {
        Authorization => 'Basic bXl1c2VyOm15cGFzc3dvcmQ=',


There's probably some magic where I can just generate this shit automatically, but my google-fu is weak and I can't find such a thing.

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful: | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt