IFrame and credentials

G

Guest

Hi

How do I (in code) provide credentials in the form of user/pwd to a
webapplication I expect to host inside an IFrame tag.
From a scan of the properties of an Iframe, I do only see the src attribute
allowing my to set the source...

Thanks in advance!
 
B

bruce barker \(sqlwork.com\)

there aren't any. if its a really old web site you can pass the login in the
url., but not recommended. if your the same domain, you can use a cookie.
you could also pass a ticket on the url.

-- bruce (sqlwork.com)
 
G

Guest

Thanks.

I am thinking whether I can perform an "artificial" logon before setting the
scr?
This way I should obtain a valid logon session with the remote server
(ASP.NET App). before setting the url of the IFrame?

Something like this:

//perform a logon to the image server
string url =
ConfigurationManager.AppSettings[WebHelper.RemoteServerParameters.IMAGE_APPROVAL_KEY];
string usr =
ConfigurationManager.AppSettings[WebHelper.RemoteServerParameters.IMAGE_SERVER_USR_KEY];
string pwd =
ConfigurationManager.AppSettings[WebHelper.RemoteServerParameters.IMAGE_SERVER_PWD_KEY];

WebRequest req = WebRequest.Create(url);
req.Credentials = new NetworkCredential(usr, pwd);
WebResponse resp = req.GetResponse();

this.frmImageApproval.Attributes["src"] =
req.RequestUri.AbsoluteUri;
--
rgds.
/Claus Konrad


bruce barker (sqlwork.com) said:
there aren't any. if its a really old web site you can pass the login in the
url., but not recommended. if your the same domain, you can use a cookie.
you could also pass a ticket on the url.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top