Solved

Accessing images using basic authentication

Posted on 2006-11-14
9
282 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
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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Citrix policies are the most efficient method to configure and tune XenDesktop environments, allowing organizations to control connection, security and bandwidth settings based on various combinations of users, devices or connection types.  Citrix …
When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

947 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now