LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-18-2011, 04:37 AM   #1
Felipe
Member
 
Registered: Oct 2006
Posts: 248

Rep: Reputation: 26
javascript: Which is the easiest way to pass data between servers?


Hallo:

My problem is:
- A webclient (WC) tries to access a web server (WS), but this requires an authentication obtained from a key server (KS).

So what I do:
- The WC tries to access a page in the WS, but this return an error saying that requires to authenticate (really, it requires a ticket saved in a cookies).
- So the client is redirected to KS to obtain the cookie, this is returned to the client, creates the cookie to access the WS and retries the access to the WS.
And this way, it works.

This is the idea, but really, it's a bit more complicated. In detail:
- When WC receives the error, it creates a hidden iframe which calls the TS for generating the ticket. The TS returns the ticket in the iframe. But I don't create the cookie there because I want the cookie to be used for url of WS. So I call a page of WS called "saveTicket.jsp?ticket=xxxxx" which saves the ticket in WC.
With the ticket saved for server WS, the WC retries the url and access.

My problem is that it's a bit complicated mechanism. For requesting the ticket, I've to use get method. If use post, not all navigators work (IE6, IE7, firefox 3.0, konqueror). And even konqueror doesn't work with iframe and get.

So, what's the best way for implementing a "SSO/requesting data" between servers (they can be in a different domain)?

Is there an easiest way to do this mechanism?

Thanks

Last edited by Felipe; 09-18-2011 at 04:39 AM.
 
Old 09-18-2011, 05:10 AM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Sounds like you're tring to work around the same-origin policy of cookies.

Can you not make the KS provide the ticket details as XML, that you can then easily get and use to form your WS query/cookie?

I'm assuming your WS is validating that the WC is authorised as well as authenticated before it lets saveTicket.jsp?ticket=xxxxx work? Otherwise you sound ripe for XSS exploits and just general problems with spiders, proxies & prefetchers.

Last edited by Proud; 09-18-2011 at 05:15 AM.
 
  


Reply

Tags
javascript, redirect


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Easiest way to sync system time between two servers? JohnRock Linux - Networking 3 06-06-2009 07:26 PM
What is the easiest way to run a shell script in the background on 10 servers? abefroman Linux - Software 3 03-12-2008 09:24 AM
how to pass a php variable to javascript functions? mohtasham1983 Programming 5 10-07-2007 07:59 AM
pass javascript variable to php ALInux Programming 6 01-06-2006 06:20 AM
How to pass data from one apllication to another. Darkeye Linux - Software 6 10-17-2005 01:10 AM


All times are GMT -5. The time now is 04:45 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration