C# - Query Data From A Password Protected Https Website?
Apr 14, 2010
I'd like my application to query a csv file from a secure website. Currently I have the user login to the site, manually query the csv, and have my application load the file locally. I'd like to automate this by having the user enter his login information, authenticating him on the website, and querying the data. The application is written in C# .NET. The url of the site is: https://www2.emidas.com/default.asp.
I've tested the following code already and am able to access the file once the user has already authenticated himself and created a manual query.
System.Net.WebClient Client = new WebClient();
Stream strm = Client.OpenRead("https://www3.emidas.com/users/<username>/file.csv");
Here is the request sent to the site for authentication. I've angle bracketed the real userid and password.
POST /pwdVal.asp HTTP/1.1
Accept: image/jpeg, application/x-ms-application, image/gif, application/xaml+xml, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; Tablet PC 2.0; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; .NET4.0C; .NET4.0E)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Cookie: ASPSESSIONID<unsure if this data contained password info so removed>; ClientId=<username>
Host: www3.emidas.com
Content-Length: 36
Connection: Keep-Alive
Cache-Control: no-cache
Accept-Language: en-US
client_id=<username>&password=<password>
Am trying to open a .pps/.ppt file through my vb.net code.....due to secure reasons this file is password protected,
However i will not like the end user to put a password when accessing through my application.
Hence i want to pass a password as a parameter while open such a password protected file.
Here is my code.
Reference URL: http://support.microsoft.com/kb/303717/EN-US/ Dim oApp As Microsoft.Office.Interop.PowerPoint.Application Dim oPres As Microsoft.Office.Interop.PowerPoint.Presentation Dim objpresset As Microsoft.Office.Interop.PowerPoint.Presentations oPres = objpresset.Open(filename, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoCTrue, Microsoft.Office.Core.MsoTriState.msoCTrue)
Where can i provide password while opening a ppt file...
With the System.IO.Compression i am able to convert a file to zip but how to make it password protected. I dont want to use any third-party library or dll. Is it possible to make a file password protected within c#. do not provide the link that doesn't meet above scenario.
I have a website that has anonymous authentication enabled. Now for a particular folder I want the users to be logged in with a userid and password. The user id and password is going to be same for everyone.
Eg user id is TEST and Password is answer. How can I do that?
I went in to that folder ->properties->directory security->edit-> And I disabled the anonymous access
But where should I add the User Id and Password? Under which option.
I'm running IIS 6 with ASP.NET 2.0.I enabled windows authentication for a folder in a website and gave permissions to a user. When I navigate to the page, the passowrd prompt pops up as expected and when entered correctly, the page loads. The page contains a file upload control. When I try to upload a file, the password prompt keeps popping up. ultimately it ends up as a 401 error. The user account does have write permissions to the floder, so I'm not understanding why I can get to the page with the credentials, but can't upload anything to that folder.
i have table data which i am currently writing to an excel file, but i need to be able to securely password protect the file. Ive been told excel passwords are easy to break, so is there another file type which i can dynamically write to and password protect for emailing elsewhere (and requiring receiver to type password in to access it)?
how can we attached secure PDF to mail in asp.net ...(Means when we attache any pdf to mail after getting mail at d opening of pdf it should ask password..)
I want to make my web.config password protected so that external users do not open it. But my application should be able to access. Is there any way to do this?
I'm looking to deploy a web app and I have a simple question about the <location> tag of the web.config file. For the moment, I want all the pages to be password protected and I've created a simple login page with the login object. I've put all my .aspx file in a directory called AppMyPages and I've put this in the config file:
I have completed sending attachment/pdf with email.
I have to send password protected attachment/pdf while sending email so that reciepeint should be asked to enter password while opening attachment/pdf and he will open attachment/pdf only after entering password.
I would like to connect to a password protected shared location that has an access database using an ASP page. I have the user name and password needed to connect to the shared location but I am not sure how to set up the connection string in order to get this done. The access database I would like to connect to does not need a username or password, only the shared location does.
i just want simple mechanism to make images update at my website copyright protected, so i want to protect them witht the password. any of the techinque will do , i just want the iamges to be password protected so that i can dignose whether the uploaded image is not from my site.
Is it safe to send a POST to a web method with a JSON string containing a clear text version of a password for authentication?Who could sniff that password on the way from client to web method? I saw some posts a while ago on "salting" a password - is that something you do in JS on the client side and then "unsalt" on the server?
I am kinda new to WCF and the setting up of service and have 2 questions. My first question I have a service that will be accessed via https on a web server. However locally on my local IIS7, it will be accessed via http as https is not available. How can I set up a service to be accessed by both?
My second question is regarding how I can set up a service that requires a username and password to be accessed. The service that I have in place I dont want methods within it to be accessed unless the calling application has the rights to do so?
Here is an example of the relevant area of my web.config file.
<system.serviceModel> <bindings> <webHttpBinding> <!-- standard AJAX binding that supports SSL --> <binding name="TransportSecurity"> <security mode="Transport" />
[Code].....
In this config, the service is set up for http only and not username/password applied to it.
I just moved our website to a new server(windows 2008, IIS7.5). this website needs to do post to an outside https website to get the data back, but
it deesn't work. when i put the https: website on the IE address bar, it failed. I am wondering what setting i need to change to enable https: website to go through on the server?
Webserver1 has been in the organization a few years and is hosting/running multiple websites with https encryption (app1.ourcompany.com, app2.ourcompany.com, etc). It has a valid, signed certificate.
Webserver2 is a new server, for which I am responsible. I am tasked with setting up https and getting the certificate, etc. It has a web app running on it, but it does not have a domain name (only has an IP address)...which as I recently learned, is a requirement for a signed certificate.
What I'd like to know is this -- is it possible to set up a site on Webserver1 that points to the site I'm hosting on Webserver2 (ie SiteOnWebserver2.ourcompany.com) which also utilizes the Webserver1's signed/verified certificate?
What I want to do is like the web browser. When you visit a https web site, the browser will download and install the X.509 Certification automatically.
I have a application which will be installed in PC, and the application will post to a https website. So if the certification is expired, the App should download a new one.
So, how can I get the certification? A stream is always good, I can make it to certification.
i have to build a small webapp for a company to maintain their business data... Only those within the company will be using it, but we are planning to host it in public domain, so that the employees can connect to app from various locations. (Till now I have built web apps that are hosted internally only)
I'm wondering whether I need to use a secured connection (https) or just the forms authentication is enough.
What should I do to prepare my website for https. (Do I need to alter the code / Config) Is SSL and https one and the same... Do I need to apply with someone to get some license or something. Do I need to make all my pages secured or only the login page...
I purchased a certificate from my hosting provider from my web site. There was some confusion as to whether I needed to use IIS to install it or if they would. After a few days and several phone calls they said they had it installed and configured, but when I tried to set up rewrite rules in web.config the site would not load. When I point my browser to https:mydomain it would load, but there was not green lock in the address bar and 'HTTPS' was not green. I contacted them again and after explaining the situation and being put on hold for 45 minutes I hung up. This morning the the site is working and HTTPS appears to be configured correctly.
I could find no changes to web.config on redirection, so how is it being redirected to HTTPS? I'm concerned that when I post changes to the site I could wipe out what ever they did to get it to work with HTTPS. Could changes been made 'above' my site on the server that I can't affect? Should I be concerned?