Doing a serverside post and ending up at post server

  • Thread starter Thread starter John Dalberg
  • Start date Start date
J

John Dalberg

Hello

For a single signon solution, I am putting a login form for a remote server
on my own site. When the form gets posted, the asp.net creates a
httpwebrequest object, does the post, gets the request, flushes the current
response object, puts the response from the post into the current post and
it gets sent back to the browser. The browser shows the after login page
correctly.

The problem is that the browser's url is still showing the original url. I
want the browser to show the remote url as if I am logged in into their
site.

If I try response.redirect, I am at the remote's site login page. Their
site doesn't use cookies. response.redirectlocation doesn't work either.

John Dalberg
 
Response.Redurect("user:p[email protected]")

That won't work for an html based form, plus the form has hidden fields
whose values are created dynamically for session tracking. Part of my
asp.net code is doing html scraping to get these values before I do a post
server side.

John
 
the url in the browser matches the request, and the only way to change it is
thru a redirect (which causes a new browser request). this is to prevent
what your are trying to do, create a Trojan horse.

-- bruce (sqlwork.com)
 
Ahh...
Could you do the FORM and POST it to "user:p[email protected]" (as the
ACTION)? The remote page should be able to use all your FORM field values
then.

Hmm.. well... the remote login is an html form which has hidden fields with
dynamic values. This means MY form needs to have these hidden fields also
which means before MY home page loads up, it needs to make a call to the
remote login page, get these values, plug them into my form before it
displays. I guess I have to code this functionality to test. I'll give it a
shot. Thanks.

John
 
Ahh...
Could you do the FORM and POST it to "user:p[email protected]" (as the
ACTION)? The remote page should be able to use all your FORM field values
then.

How can you use post to a remote server without Javascript and get redirect
to the remote server? A simple Response.Redirect won't do.

John
 
have you looked at using XMLHTTP to query the remote page for the info?

I am not sure why I should use it. I able to query everything I need. My
problem is having my browser show the remote url after doing ll the
processing on the server wide. I am also staying away from using Javascript
and object on the client side.

I actually have a Javascript solution where the server creates a form
dynamically with the hidden fields and a render-time javascript which
automatically submits the form on load. It doesn't work for javascript
disabled browsers. That's why I am looking for a non Javascript dependent
solution.

John
 
Back
Top