Solved

Accessing images using basic authentication

Posted on 2006-11-14
9
285 Views
Last Modified: 2010-04-01
Hi,

I have a simple JSP page that must display an image located on a remote server. This remote server uses basic authentication. The credentials to access the remote image are known to my application.

How can I display the image without prompting the user to enter credentials (username/password dialog).

Any suggestions welcome.

Thanks,

Warren
0
Comment
Question by:frostw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 10

Expert Comment

by:jaggernat
ID: 17947674
>>>>This remote server uses basic authentication

you have to configure your remote server so that it allows users to log in without authentication
0
 

Author Comment

by:frostw
ID: 17950492
>>you have to configure your remote server so that it allows users to log in without authentication

Sorry but that is not an option.
0
 
LVL 29

Expert Comment

by:bloodredsun
ID: 17955421
Why do you want to do this frostw? Why not host the images on your own machine?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:frostw
ID: 17960447
We have a server collecting router traffic data and generating graphs (the .png images in question). The graphs are available to external applications via a cgi interface which is protected by basic authention. The images are generated on demand and therefore cannot be hosted locally by my application.

Since I can call Java code from my JSPs I believe I can fetch the images using a URLConnection. This would allow me to cope with the authentication (I think). However, what I don't know how to do is insert the fetched image back into the HTML that the JSP generates.
0
 

Author Comment

by:frostw
ID: 17990477
So I take it this is not possible then?!
0
 

Author Comment

by:frostw
ID: 18015889
No matter, I figured it out myself. Just in case anyone is interested I achieved it using a servlet to fetch the image (using basic authentication) then returned the data with an "image/png" content type.
0
 

Author Comment

by:frostw
ID: 18015944
I am going to ask that this question be closed.
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 18058260
PAQd, 500 points refunded.

DarthMod
CS Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
tomcat users xml 7 147
lessBy10  challenge 15 97
Looking for some programs to resell or buy source codes 1 79
glassfish admin console 1 53
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question