I have a Rails app that shows catalogs of images. The images are
generated by a CGI that requires REMOTE_USER to be set. This is
accomplished by protecting the CGI folder with Basic Auth.
I can see how to implement Basic Auth in Rails, and this looks like it
will then allow Rails to reference the images (as long as my
authenticated Rails user matches a realm user). The problem is, I’d like
the option of emailing direct links to some images, so that the
recipient can click on a url to view a single image (this can be inside
a Rails template). In this case, I don’t want the user to be challenged
- some component of the url can be decoded to determine who the user is.
Is there any way to “silently” set the authentication credentials, or
set the REMOTE_USER on the fly so the CGI sees it and executes?