tags:

views:

203

answers:

1

I am looking for a way to allow a user on my web site to log into another external web application (for example: gmail, jira,etc..) and redirect them successfully to the landing page.

I found this article which provides some code for posting the log on info, but doesn’t discuss what other actions I need to take (For example I believe I have to create or save a cookie on the machine) that will allow me to successfully redirect the user to that site. Does anyone have any code or resources that can point me in the right direction?

Thanks for your help!

+1  A: 

It's not possible. Especially with the cookies, you can not login to Gmail, receive a cookie from them and then redirect that to the user. The users' browser will see it as a cookie from yourdomain.com and not from gmail.com.

The link you refer to is doing something else. It logs on, retrieves data from that website and processes it (on the server). It does not redirect the user to the authenticated homepage.

ZippyV
But how does the browser receive the cookie and save it on the machine? Shouldn’t I be able to mimic this behavior?
Zaffiro
A cookie is just one line of text that is sent in the HTTP request/response. Cookies are stored by the browser per domain. You cannot sent a cookie and tell the browser of the user that it actually comes from gmail.com instead of yourdomain.com, that would not be very secure.
ZippyV