473,665 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Impersonate Login Page

My company has a third party purchased website that we use to allow clients
to log in and view/modify orders in our system.

It has its own login page, but I would like to add a form to my companies
own website to post the login directly (for client conveniance reasons).

Below is the code that I'm attempting to use, the post seems to be working
fine, but I'm getting an error back that "WebTrac Pro is not available at
this time, Please contact your administrator or check the log for details"
(the log is empty).

I'm wondering if maybe they are explicitly checking "where" the login
attempt is coming from and blocking it if it isn't what they expect? Is this
a common practice?

Here is the code:

-----------
Dim stringPost = Request.Form.To String

Dim httpWebRequest As System.Net.Http WebRequest =
System.Net.Http WebRequest.Crea te("https://web.hmic.com/webtracpro/ModelDriver.asp x")

httpWebRequest. Method = "POST"

httpWebRequest. ContentLength = stringPost.Leng th

httpWebRequest. ContentType = "applicatio n/x-www-form-urlencoded"

Dim streamWriter = New
System.IO.Strea mWriter(httpWeb Request.GetRequ estStream())

streamWriter.Wr ite(stringPost)

streamWriter.Cl ose()

Dim httpWebResponse As System.Net.Http WebResponse =
httpWebRequest. GetResponse()

Dim streamReader = New
System.IO.Strea mReader(httpWeb Response.GetRes ponseStream())

Dim stringResult = streamReader.Re adToEnd()

streamReader.Cl ose()

Response.Write( stringResult)
---------
Nov 19 '05 #1
1 1457
On Mon, 15 Aug 2005 10:13:07 -0700, "PokerJoker "
<Po********@dis cussions.micros oft.com> wrote:
I'm wondering if maybe they are explicitly checking "where" the login
attempt is coming from and blocking it if it isn't what they expect? Is this
a common practice?


I'd suggest using Fiddler [1] to compare what your code sends to the
web site with what a web browser sends. Sometimes it's the littlest
things that make the difference, for instance, I've come across more
than one site that checks the user agent string. If the sites didn't
recognize the user agent they'd simply return a 404 or a 500 code. You
can set your own user agent string to make your request look like an
IE request with the UserAgent property on HttpWebRequest.

[1] http://www.fiddlertool.com/fiddler/

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
3439
by: Ian Frawley | last post by:
Anyone used the WindowsIdentity class with success? I find if I try to change the current identity to one that exists on another machine and then try to perform and action on that machine i.e. restart a service or list the available processes I keep getting access denied exceptions. Here is an example of my code: public extern static bool LogonUser(String lpszUsername, String lpszDomain, String lpszPassword, int dwLogonType, int...
2
4621
by: Divya | last post by:
Hello, I am developing a simple move file utility to move files from one domain to another in the same internal network. My program runs fine when it reads the parameters (user, domain, password etc) from a XML file to move files across the internal network to a different domain. This is a console application that should have the option of specifying the parameters at the commandline prompt. When I specify the parameters at cmd line, it...
3
2226
by: Kathy Burke | last post by:
Hi. Totally lost on this one (ok, I admit I'm USUALLY lost!). All works fine in dev environment (P4, localhost server IIS, XP Pro) Asp.net and .Net 1.1 In order to access doc files needed for the app, I had to add the following to <system.web> in webconfig. <identity impersonate="true" userName="Jabil\BOSASPNET" password="@ugustus" />
6
2393
by: Erez Shor | last post by:
Hi, I need to build and asp page which access a remote windows server's registry and create a registry key. In order for the ASP page to be able to access the registry on the remote server I need it to run using credentials supplied by the user. When using basic authentication this is not an issue since the user has to provide a user name and password. But I don't want to use basic authentication so I created a login form and I am using...
1
1755
by: Sorin Sandu | last post by:
How can I override Identity Impersonate setting from machine.config on a site on the same server ? I am using impersonate on most web sites but on one I need to use Windows Identity.
8
2148
by: ajamrozek | last post by:
I have an ASPX page that needs to display data from an Access DB that resides on a network resource other than the running server. To access the web page itself, I need IIS to have anonymous login set to true, but to access the Access DB I need to pass an authenticated network user. Not for the DB's sake but for the network directory that it resides on. Some more environment background: large company with tight server control. I don't...
6
3090
by: richi | last post by:
Hi... Okay this is driving me mad. I have a very simple webpage served up from my webserver which uses the following code to populate 3 labels. lblOne.Text = Page.User.Identity.Name lblTwo.Text = System.Security.Principal.WindowsIdentity.GetCurrent().Name lblThree.Text = System.Threading.Thread.CurrentPrincipal.Identity.Name In my web.config file I have :-
0
865
by: Andrew R. Jones | last post by:
I have a web app that is running inside a controlled enviroment that needs to access files ( create/read/write ) on a network drive. I used the identity impersonate to true in the web.config and set my dev box IIS to not allow anonymous login ( Integrated Windows Authentication only ). When I do this and launch the localhost/asppage and get to my file access page it works. I write out to the screen the following variables:...
4
5804
by: =?Utf-8?B?QXZhRGV2?= | last post by:
ASP.Net 2. We are migrating to Windows 2008 64 bit Server with IIS 7 from Windows 2003 32 Bit with IIS 6. A few library classes we wrote uses impersonation in code like explained in this article: http://support.microsoft.com/?id=306158#4 This doesn't work in Windows 2008 Server, we receive the following exception:
0
8779
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.