This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes How to automate the login of an external website using AJAX or javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to automate the login of an external website using AJAX or javascript " Watch "How to automate the login of an external website using AJAX or javascript " New topic
Author

How to automate the login of an external website using AJAX or javascript

T Zaman
Greenhorn

Joined: Oct 31, 2005
Posts: 18

Hi , I would like to automate the log in of an external page. Here is what I am trying to do, I have two frame top frame contains some buttons. If I click the button I want an external web page to call with page that is already logged in using the user name and password. Is it possible to get the login page on the bottom page and input the user name and pasword automatically so that it calls the logged in page( the form of the log in page ) ? how can I do that with ajax ? is there any good ajax self help page when I can get tutorial for AJAX


SCJP 5.0 SCWCD 5.0
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
JavaScript has a same domain policy. It is impossible for it to interact with another domain.

Would you want a site to log into your bank account and make some transactions? Bye Bye money!

Eric
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What you are possibly looking for is Single Sign-On. Is the external website one of yours or a completely unrelated one?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
T Zaman
Greenhorn

Joined: Oct 31, 2005
Posts: 18
Paul Sturrock wrote:What you are possibly looking for is Single Sign-On. Is the external website one of yours or a completely unrelated one?


yes Paul, I am trying to do something like that. What approach should I take? what would be the best approach. Please provide some suggestions.thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
First thing I would do if I were you would be: http://www.google.com/search?q=Single+Sign+on+Java

Eric
T Zaman
Greenhorn

Joined: Oct 31, 2005
Posts: 18
Eric Pascarello wrote:First thing I would do if I were you would be: http://www.google.com/search?q=Single+Sign+on+Java

Eric


thanks a lot . But can I not do something like that with Ajax? if so is there any Ajax tutorial that I can use to learn Ajax.
Sean Clark
Rancher

Joined: Jul 15, 2009
Posts: 377

Hey,

There are loads of ajax tutorials, again a google search will reveal all.

Sean


I love this place!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
As I already stated, you CAN NOT talk to another domain with Ajax or JavaScript. There is security measures in place to protect you.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Trying to do something like this from the client is nothing short of madness.

SSO is a well-known concept. Search for ways to implement it properly.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to automate the login of an external website using AJAX or javascript
 
Similar Threads
Keeping track of Logged users
How to check if the user is logged in in JSF
Single login for a Particular url
controlling browsers back button
Using JAAS