Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Accessing images using basic authentication

Posted on 2006-11-14
9
Medium Priority
?
291 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Experts give $3,000 toward hurricane relief efforts—but that's not all!
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

670 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