From: Ari Roponen <ari.roponen@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: How to non-interactively provide auth info to URL, and how to force URL to use HTTP AUTH
Date: Wed, 16 Dec 2009 08:30:23 +0200 [thread overview]
Message-ID: <m3k4wnxwg0.fsf@gmail.com> (raw)
In-Reply-To: 3b31caf90912151202j7dc91abat65e21a11aa636ef0@mail.gmail.com
Hi,
"Edward O'Connor" <hober0@gmail.com> writes:
> Here's the scenario: I work on several elisp clients for various APIs
> which are exposed via HTTP and make use of HTTP AUTH. When a developer
> uses my library, they supply the relevant auth info to my library
> explicitly. I would then like to invoke url-retreive and have the
> resulting request use basic (or digest) auth with the auth info I
> already have, *without prompting the user* for a username or password. I
> keep failing to figure out how to do this.
I have used something like this to get status information from my
ADSL-modem. I don't know if it is the right thing, but it has worked for
me.
(defvar telewell-default-auth
`(("192.168.0.254:80"
("WebAdmin" . ,(base64-encode-string "admin:password"))))
"Default authorization data for Telewell ADSL modem.")
(defun telewell-get-data ()
(let* ((url-show-status nil)
(url-basic-auth-storage 'telewell-default-auth)
(buf (url-retrieve-synchronously
"http://192.168.0.254/adsl.asp")))
(when buf
...)))
--
Ari Roponen
prev parent reply other threads:[~2009-12-16 6:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-15 20:02 How to non-interactively provide auth info to URL, and how to force URL to use HTTP AUTH Edward O'Connor
2009-12-16 0:36 ` Juri Linkov
2009-12-16 8:56 ` Andreas Schwab
2009-12-16 6:30 ` Ari Roponen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3k4wnxwg0.fsf@gmail.com \
--to=ari.roponen@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).