JP2011257810A - Relay server device, cookie control method and cookie control program - Google Patents
Relay server device, cookie control method and cookie control program Download PDFInfo
- Publication number
- JP2011257810A JP2011257810A JP2010129428A JP2010129428A JP2011257810A JP 2011257810 A JP2011257810 A JP 2011257810A JP 2010129428 A JP2010129428 A JP 2010129428A JP 2010129428 A JP2010129428 A JP 2010129428A JP 2011257810 A JP2011257810 A JP 2011257810A
- Authority
- JP
- Japan
- Prior art keywords
- cookie
- domain
- browser
- script
- request
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
Description
本発明は、中継サーバ装置、クッキー制御方法およびクッキー制御プログラムに関する。 The present invention relates to a relay server device, a cookie control method, and a cookie control program.
近年、Webサーバがブラウザを通じてクライアントのコンピュータに一時的にクッキー情報を書き込んで保存させるクッキー(cookie)に関する技術が知られている。このように保存されたクッキー情報について、ブラウザがアクセスした複数のドメインの祖先ドメインが共通する場合には、クッキー情報を共有して利用することが知られている。例えば、ドメイン「sso.example.com」とドメイン「ap1.example.com」とは、祖先ドメイン「example.com」が共通しており、「sso.example.com」にアクセスしたブラウザと「ap1.example.com」にアクセスしたブラウザとでクッキー情報を共有して利用する。 2. Description of the Related Art In recent years, a technique related to cookies in which a Web server temporarily writes and stores cookie information on a client computer through a browser is known. It is known that the cookie information stored in this way is shared and used when the ancestor domains of a plurality of domains accessed by the browser are common. For example, the domain `` sso.example.com '' and the domain `` ap1.example.com '' have the same ancestor domain `` example.com '', and the browser that accessed `` sso.example.com '' and `` ap1.example.com ''. Share and use cookie information with the browser that accessed "example.com".
ここで、図14の例を用いて、祖先ドメインが共通する場合に、クッキーを共有して利用する処理について説明する。図14は、祖先ドメインが共通する場合に、クッキーを共有する処理について説明する図である。例えば、図14に示すように、ユーザがクライアント装置のブラウザA上から「sso.example.com」のWebアプリケーションでログイン処理を行うと、祖先ドメイン「example.com」の指定があるクッキーセット指示がWebサーバからブラウザAへ送信される。図14の例では、クッキーセット指示として、「Set-Cookie:sid=1234;domain=.example.com」というSet-Cookieヘッダを含んだHTTP(Hypertext Transfer Protocol)レスポンスがWebサーバからブラウザAに送信される。 Here, a process for sharing and using a cookie when an ancestor domain is common will be described using the example of FIG. FIG. 14 is a diagram illustrating processing for sharing a cookie when an ancestor domain is common. For example, as shown in FIG. 14, when the user performs a login process with the web application “sso.example.com” from the browser A of the client device, a cookie set instruction with the designation of the ancestor domain “example.com” is displayed. It is transmitted from the Web server to browser A. In the example of FIG. 14, an HTTP (Hypertext Transfer Protocol) response including a Set-Cookie header of “Set-Cookie: sid = 1234; domain = .example.com” is transmitted from the Web server to the browser A as a cookie setting instruction. Is done.
そして、ブラウザAは、クッキーセット指示「Set-Cookie:sid=1234;domain=.example.com」を受信すると、祖先ドメイン「example.com」を特定し、祖先ドメイン「example.com」に対応付けてクッキー情報「sid=1234」を書き込む。 Upon receiving the cookie set instruction “Set-Cookie: sid = 1234; domain = .example.com”, the browser A identifies the ancestor domain “example.com” and associates it with the ancestor domain “example.com”. Write the cookie information “sid = 1234”.
このように書き込まれたクッキーは、祖先ドメイン「.example.com」に対応付けて記憶されているため、「sso.example.com」だけでなく「ap1.example.com」にアクセスする場合にも、クッキーを送信する。例えば、「sso.example.com」へのログイン処理後に、ユーザがブラウザBから「ap1.example.com」にアクセスすると、「sso.example.com」へのログイン処理で送られてきたクッキー「Cookie:sid=1234」をHTTPリクエストのヘッダとしてWebサーバに送信する。 The cookie written in this way is stored in association with the ancestor domain “.example.com”, so even when accessing “ap1.example.com” as well as “sso.example.com” , Send cookies. For example, after the login process to “sso.example.com”, when the user accesses “ap1.example.com” from the browser B, the cookie “Cookie” sent in the login process to “sso.example.com” : sid = 1234 "is transmitted to the Web server as an HTTP request header.
また、Webサーバとクライアント装置との間に、URI(Uniform Resource Identifier)を置換する中継サーバが設けられている場合がある。具体的には、中継サーバは、URIのドメイン部分のドット「.」をハイフン「-」に置換するとともに中継サーバのホスト名を付加して、URIを置換する。例えば、図14の例を用いて説明すると、中継サーバは、中継サーバのホスト名が「r.test」である場合には、「sso.example.com」を「http-sso-example-com.r.test」に置換し、「ap1.example.com」を「http-ap1-example-com.r.test」に置換する。 In some cases, a relay server that replaces a Uniform Resource Identifier (URI) is provided between the Web server and the client device. Specifically, the relay server replaces the URI by replacing the dot “.” In the domain part of the URI with a hyphen “-” and adding the host name of the relay server. For example, referring to the example of FIG. 14, when the host name of the relay server is “r.test”, the relay server changes “sso.example.com” to “http-sso-example-com. Replace with “r.test” and replace “ap1.example.com” with “http-ap1-example-com.r.test”.
しかしながら、上述した中継サーバがURIを置換する技術では、URIのドメイン部分が置換されるので、ドメインの親子関係が消滅してしまい、クッキー共有ができなくなり、クッキー情報の書き込み処理を適切に実行することができないという問題があった。 However, in the above-described technology in which the relay server replaces the URI, the domain part of the URI is replaced. Therefore, the parent-child relationship of the domain disappears, cookie sharing becomes impossible, and the cookie information writing process is appropriately executed. There was a problem that I could not.
例えば、図14の例では、「sso.example.com」が「http-sso-example-com.r.test」に置換され、「ap1.example.com」が「http-ap1-example-com.r.test」に置換され、祖先ドメインである「example.com」が「http-example-com.r.test」に置換されることとなる。ここで、ブラウザ側では、ドットがハイフンになっているので、「http-sso-example-com.r.test」および「http-ap1-example-com.r.test」の祖先ドメインが「http-example-com.r.test」であることを特定できない。このため、ドメインの親子関係が消滅してしまい、祖先ドメインのクッキー情報の書き込み処理を適切に実行することができない。 For example, in the example of FIG. 14, “sso.example.com” is replaced with “http-sso-example-com.r.test”, and “ap1.example.com” is “http-ap1-example-com. “example.com”, which is an ancestor domain, is replaced with “http-example-com.r.test”. Here, on the browser side, the dot is a hyphen, so the ancestor domains of "http-sso-example-com.r.test" and "http-ap1-example-com.r.test" are "http- "example-com.r.test" cannot be specified. For this reason, the parent-child relationship of the domain disappears, and the cookie information writing process of the ancestor domain cannot be appropriately executed.
一つの側面では、中継サーバを経由してブラウザからWebアプリケーションにアクセスする場合であっても、クッキー情報の書き込み処理を適切に実行することを目的とする。 An object of one aspect is to appropriately execute cookie information writing processing even when a Web application is accessed from a browser via a relay server.
第一の案では、サーバからブラウザに対するクッキー書き込み指示情報を受信した場合に、該クッキー書き込み指示情報をスクリプトの呼び出し情報に置換する。そして、スクリプトの呼び出し情報に対して、ブラウザのリクエスト先ドメインの祖先ドメインに対応するフレームを作成させるとともに該フレームに祖先ドメインに対応するクッキーの書き込み指示をクロスドメイン通信で送信するスクリプトを追加する。 In the first proposal, when the cookie write instruction information for the browser is received from the server, the cookie write instruction information is replaced with script call information. Then, a script for creating a frame corresponding to the ancestor domain of the request destination domain of the browser and adding a cookie write instruction corresponding to the ancestor domain to the frame is added to the script call information.
中継サーバを経由してブラウザからWebアプリケーションにアクセスする場合であっても、クッキー情報の書き込み処理を適切に実行することができる。 Even when a Web application is accessed from a browser via a relay server, cookie information writing processing can be appropriately executed.
以下に添付図面を参照して、この発明に係る中継サーバ装置、クッキー制御方法およびクッキー制御プログラムの実施例を詳細に説明する。 Exemplary embodiments of a relay server device, a cookie control method, and a cookie control program according to the present invention will be described below in detail with reference to the accompanying drawings.
以下の実施例では、実施例1に係る中継サーバの構成および処理の流れを順に説明し、最後に実施例1による効果を説明する。 In the following embodiments, the configuration and processing flow of the relay server according to the first embodiment will be described in order, and finally the effects of the first embodiment will be described.
[中継サーバの構成]
まず最初に、図1を用いて、中継サーバ10の構成を説明する。図1は、実施例1に係る中継サーバ10の構成を示すブロック図である。図1に示すように、この中継サーバ10は、リクエスト判別部11、中継部12、クッキー操作ページ返却部13を有し、Webサーバ20および利用者端末のブラウザ30と接続される。以下にこれらの各部の処理を説明する。
[Configuration of relay server]
First, the configuration of the
Webサーバ20は、中継サーバ10を経由して利用者端末のブラウザ30からアクセスがあると、アクセスをしてきた利用者端末のブラウザ30に対してHTML(HyperText Markup Language)文書や画像などの情報をレスポンスとして中継サーバ10経由で送信する。ブラウザ30は、中継サーバ10を経由してWebサーバ20にリクエストを送信し、リクエストに対するレスポンスを中継サーバ10経由でWebサーバ20から受信する。
When accessed from the
リクエスト判別部11は、リクエストのパスが特定のファイル名(例えば、「CookieHandler.html」)であるか判定し、リクエストのパスが特定のファイル名である場合に、クッキー操作ページへのリクエストであると判別する。具体的には、リクエスト判別部11は、ブラウザからリクエストを受信し、リクエストのパス部分を検出し、パスのファイル名と特定のファイル名(例えば、「CookieHandler.html」)とが一致しているか判定する。
The
この結果、リクエスト判別部11は、リクエストのパス部分を検出し、パスのファイル名と特定のファイル名とが一致すると判定した場合には、後述するクッキー操作ページ返却部13へリクエストを通知する。また、リクエスト判別部11は、リクエストのパス部分を検出し、パスのファイル名と特定のファイル名とが一致しないと判定した場合には、後述する中継部12へURIを通知する。
As a result, the
例えば、リクエスト判別部11は、リクエストのパスが「/CookieHandler.html」や「/dir1/dir2/CookieHandler.html」となっているリクエストについては、クッキー操作ページ返却部13にリクエストを通知する。
For example, for the request whose request path is “/CookieHandler.html” or “/dir1/dir2/CookieHandler.html”, the
また、リクエスト判別部11は、リクエストのパスが「/」や「/CookieHandler.html/dir/」なっているリクエストについては、中継部12へリクエストを通知する。なお、「CookieHandler.html」などの指定のファイル名は、中継サーバが自由に設定できるものであり、別のファイル名でもよく、他のWebサーバで使われていないファイル名で設定するのがよい。
Further, the
中継部12は、Webサーバ20と利用者端末のブラウザ30との間の通信を中継し、リクエスト代行部12a、URI置換部12b、クッキー置換部12c、スクリプト追加部12dを有する。
The
URI置換部12bは、Webサーバ20からブラウザ30に対するレスポンスを受信した場合に、ブラウザ30のURIを置換する。具体的には、URI置換部12bは、Webサーバ20から受信したURIのドメイン部分のドット「.」をハイフン「-」に置換するとともに、中継サーバのホスト名「r.test」を付加する。
The URI replacement unit 12 b replaces the URI of the
例えば、URI置換部12bは、Webサーバ20から「http://sso.example.com」を受信すると、「http://http-sso-example-com.r.test」に置換する。また、URI置換12bは、ブラウザ30から「http://http-sso-example-com.r.test/login/login」を受信すると、「http://sso.example.com/login/login」に復元し、リクエスト代後部12aに通知する。
For example, when receiving “http://sso.example.com” from the
リクエスト代行部12aは、利用者端末のブラウザ30から受信したリクエストを受信すると、リクエスト中のドメインを解釈してWebサーバにリクエストを送信する。具体的には、リクエスト代行部12aは、URI置換部12bからURIを受信し、受信されたURIを用いて、Webサーバ20にリクエストを送信する。
When receiving the request received from the
クッキー置換部12cは、Webサーバ20からブラウザ30に対するクッキー書き込み指示情報を受信した場合に、クッキー書き込み指示情報をスクリプトの呼び出し情報に置換する。具体的には、クッキー置換部12cは、Webサーバ20からのレスポンスにSet-CookieヘッダやJava(登録商標)Script中のdocument.cookieへの代入が含まれているか判定する。この結果、Webサーバ20からのレスポンスにSet-Cookieヘッダやスクリプト中のdocument.cookieへの代入が含まれていると判定した場合には、Set-Cookieヘッダやスクリプト中のdocument.cookieをsetCookieFunc関数の呼び出しへと置換する。
The
スクリプト追加部12dは、スクリプトの呼び出し情報に対して、ブラウザ20のドメインの祖先ドメインに対応するフレームを作成させるとともにフレームに祖先ドメインに対応するクッキーの書き込み指示をクロスドメイン通信で指示するスクリプトを追加する。例えば、スクリプト追加部12dは、クッキー置換部12cによってsetCookieFunc関数の呼び出しに置換された後に、setCookieFunc関数の定義をHTML文書内に追加する。
The
また、スクリプト追加部12dは、祖先ドメインのフレームのパスのディレクトリをブラウザ20からのレスポンスの受信先フレームのパスのディレクトリと同じにしたiframe要素を作成するスクリプトを追加する。
Further, the
例えば、スクリプト追加部12dは、親フレームが「http://sso.example.com/login/login」であり、「Set-Cookie:sid=1234;domain=.example.com;path=/」のクッキーが送られてきた場合には、iframeのURIが「http://http-example-com.r.test/login/CookieHandler.html」となる。つまり、祖先ドメインのフレームのパスのディレクトリと受信先フレームのパスのディレクトリとを「/login/」でそろえる。これにより、Set-CookieヘッダやJavaScript中のdocument.cookieへの代入でドメインやパスの指定がある場合にも、適切にクッキーを処理することができる。
For example, the
また、スクリプト追加部12dは、祖先ドメインに対応するフレームを作成させるとともに該フレームに祖先ドメインのクッキーを取得させて親フレームにクロスドメイン通信で送信させる処理を一定時間ごとに行わせるスクリプトを追加する。
In addition, the
例えば、Webサーバ20からHTMLドキュメントのレスポンスを受信した場合に、HTMLドキュメントに対して祖先ドメインからクッキーをコピーしてくるための読取スクリプトを追加する。
For example, when a response of an HTML document is received from the
クッキー操作ページ返却部13は、中継サーバ10内に格納されているHTMLとスクリプトで構成されたクッキー操作ページを返信する。ここで、クッキー操作ページとは、ブラウザ30におけるiframe内に読み込まれることを想定されており、ドメインをまたがったクッキーの読書きを行う。なお、クッキー操作ページには、クロスドメイン通信でのセキュリティを保つためのロジックも含めるようにしてもよい。
The cookie operation
ここで、クッキーの書き込み処理について図2を用いて具体的に説明する。図2に示すように、中継サーバ10は、Webサーバ20からのレスポンスヘッダのSet-Cookieやスクリプト内のdocument.cookieへの代入を受信すると、ヘッダやスクリプトをsetCookieFunc関数への呼び出しへと置換し、setCookieFunc関数をHTML文書内に追加する。例えば、中継サーバ10は、Set-Cookie:sid=1234;domain=.example.com; path=/のヘッダをsetCookieFunc(“sid=1234;domain=.example.com;path=/”)のスクリプトに置換し、ブラウザ30に送信する。
Here, the cookie writing process will be specifically described with reference to FIG. As shown in FIG. 2, when the
そして、ブラウザ30は、setCookieFunc関数が呼ばれると、祖先ドメインの指定があるか判定する。この結果、ブラウザ30は、祖先ドメインの指定がないと判定した場合には、document.cookieにクッキーの内容を代入することでブラウザのクッキーに登録する。また、ブラウザ30は、祖先ドメインの指定があると判定した場合には、祖先ドメインを中継サーバへのURI置換を行い、親フレームと同じディレクトリにCookieHandler.htmlという予約済みのファイル名を付加したURIを表示するためのiframe要素を作成し、中継サーバ10からCookieHandler.htmlを取得する。
When the setCookieFunc function is called, the
その後、ブラウザ30は、作成したiframeにpostMessageなどのクロスドメイン通信を行って親フレームから子フレームのドメインにクッキーのセット指示を出す。指示を受けたiframe側のCookieHandler.html内のスクリプトでは、指示元が子孫ドメインであるかを確認する。この結果、指示元が子孫ドメインである場合には、iframe側でdocument.cookieにクッキーの内容を代入することで祖先ドメインへのクッキーセットを行う。
Thereafter, the
次に、図3を用いて、クッキーの読み取り処理について具体的に説明する。クッキーの読み取り処理を行うケースとして、ブラウザがHTTPリクエストにCookieヘッダを付与して送信する場合と、スクリプトがdocument.cookieを読み取る場合の2種類がある。図3に示すように、中継サーバ10は、ブラウザ30からのリクエストに対してWebサーバ20からHTMLドキュメントを取得する。
Next, the cookie reading process will be specifically described with reference to FIG. There are two cases in which the cookie reading process is performed: a case in which a browser adds a Cookie header to an HTTP request, and a case in which a script reads document.cookie. As illustrated in FIG. 3, the
そして、中継サーバ10は、取得したHTMLドキュメントに対してクッキーの読取スクリプトを追加し、ブラウザ30に送信する。その後、読み取りスクリプトがブラウザ30上で実行され、元のドメインの祖先ドメインでCookieHandler.htmlを読み込むためのiframe要素を作成する。
Then, the
例えば、ブラウザ30が、http://http-ap1-example-com.r.test/dir1/dir2/file.htmlを表示している場合に、元のドメインがap1.example.comなので祖先ドメインがexample.comであるドメインの一つである。また、ディレクトリが/dir1/dir2/であるため、http://http-example-com.r.test/dir1/dir2/CookieHandler.htmlを読み込むためのiframeが作成されることになる。なお、ドメインによっては作成されるiframeの個数はゼロや複数もありうる。
For example, when the
そして、ブラウザ30は、中継サーバ10からCookieHandler.htmlを読み込んだ後に、iframeに対してクロスドメイン通信でクッキーの取得指示を送る。iframe側のCookieHandler.htmlのスクリプトがクロスドメイン通信の送信元を確認して子孫ドメインからの通信であるかを確認する。
Then, after reading CookieHandler.html from the
この結果、子孫ドメインからの通信であることの確認が取れた場合には、スクリプトでdocument.cookieの値を読み取る。ここで読み取れるクッキーについて、CookieHandler.htmlのドメインとパスに該当するものを読取ることができる。 As a result, when it is confirmed that the communication is from the descendant domain, the value of document.cookie is read by the script. Cookies that can be read here can be read from CookieHandler.html corresponding to the domain and path.
その後、クロスドメイン通信で親フレームにクッキーの内容を伝える。親フレームは、クロスドメイン通信の送信元が祖先ドメインであることを確認し、document.cookieにクッキーの内容を代入して祖先ドメインのクッキーを親フレームのドメインでも使えるようにする。その後、クッキーの一貫性を保つために、親フレームのdocument.cookieに代入するクッキーは expires を短く設定し、フレーム間でのクッキーの読み取りを一定時間おきに繰り返して実行する。これにより、祖先ドメインであって指定パスに該当するクッキーを読み取ることができる。 Then, the contents of the cookie are transmitted to the parent frame by cross-domain communication. The parent frame confirms that the source of the cross-domain communication is the ancestor domain, and substitutes the contents of the cookie in document.cookie so that the ancestor domain cookie can be used in the parent frame domain. After that, in order to maintain cookie consistency, the cookie to be assigned to the document.cookie of the parent frame is set to expires short, and the cookie reading between frames is repeated at regular intervals. Thereby, it is possible to read a cookie corresponding to the designated path that is an ancestor domain.
[中継サーバによる処理]
次に、図4を用いて、実施例1に係る中継サーバ10によるクッキー書き込み処理を説明する。図4は、実施例1に係る中継サーバ装置によるクッキー書き込み処理の流れを示すシーケンス図である。以下の例では、http://sso.example.com/login/でログイン処理を行うと、Set-Cookie:sid=1234;domain=.example.com;path=/のレスポンスヘッダが返ってくるものとする。
[Processing by relay server]
Next, a cookie writing process by the
図4に示すように、中継サーバ10は、ブラウザ30からログインリクエストを受信する(ステップS101)。例えば、初期状態ではブラウザ30がhttp://sso.example.com/login/を中継サーバ10経由のhttp://http-sso-example-com.r.test/login/で開いている。そして、入力フォーム内のユーザ名とパスワードが入力され、ログインボタンが押されると、ブラウザ30がhttp://http-sso-example-com.r.test/login/loginにログインリクエストを送信する。
As shown in FIG. 4, the
続いて、中継サーバ10は、中継サーバのリクエスト判別部11がパスの/login/loginが「CookieHandler.html」と異なることから中継部12に処理を割り振る。そして、中継部12のURI置換部12bは、URIの復元を行いhttp://sso.example.com/login/loginというURIを得る(ステップS102)。
Subsequently, the
そして、中継部12のリクエスト代行部12aは、Webサーバ20に対してリクエストを送信する(ステップS103)。続いて、Webサーバ20は、ユーザ名とパスワードのチェックを行って妥当性が確認できると、Set-Cookie:sid=1234;domain=.example.com;path=/ヘッダの付いたレスポンスを中継サーバ10へ返信する(ステップS104)。
Then, the request proxy unit 12a of the
その後、中継サーバ10は、Webサーバ20から返ってきたレスポンスに対してURI置換、クッキー置換、スクリプト追加を行う(ステップS105)。例えば、中継サーバ10は、クッキー置換として、Set-Cookie:sid=1234; domain=.example.com;path=/のヘッダをsetCookieFunc(“sid=1234;domain=.example.com;path=/”)のスクリプトに置換する。
Thereafter, the
そして、中継サーバ10は、URI置換、クッキー置換、スクリプト追加が行われたレスポンスをブラウザ30に送信する(ステップS106)。そして、ブラウザ30は、追加されたスクリプトによってiframeを作成する(ステップS107)。ここで、sso.example.comの祖先ドメインがexample.comの一つだけであり、パスが/login/loginであるため、作成されるiframeのURIがhttp://http-example-com.r.test/login/CookieHandler.htmlとなる。
Then, the
そして、中継サーバ10のリクエスト判別部11は、URI「http://http-example-com.r.test/login/CookieHandler.html」でのリクエストをブラウザ30のiframeから受信する(ステップS108)。そして、リクエスト判別部11は、パスのファイル名がCookieHandler.htmlであることからクッキー操作ページ返却部13に処理を割り振る。続いて、クッキー操作ページ返却部13は、クッキー操作ページをクライアントに返信する(ステップS109)。
Then, the
その後、ブラウザ30側でsetCookieFunc関数が呼び出されると、指定されてあるドメインの.example.comに対応するiframeのhttp://http-example-com.r.test/login/CookieHandler.htmlに対してクロスドメイン通信でクッキーセット要求を送る(ステップS110)。そして、クロスドメイン通信を受けたiframeは、クロスドメインの通信元の妥当性をチェックする。図4の例では、送信元のドメインがhttp-sso-example-com.r.testであり、iframeのドメインがhttp-example-com.r.testとなっており、置換前のドメインでは親子関係であるため妥当であると判断する。妥当であると判断された場合には、iframe側では、document.cookie=“sid=1234;path=/”のスクリプトを実行しクッキーのセットを行う(ステップS111)。
After that, when the setCookieFunc function is called on the
次に、図5を用いて、実施例1に係る中継サーバ10によるクッキー読み取り処理を説明する。図5は、実施例1に係る中継サーバ装置によるクッキー読み取り処理の流れを示すシーケンス図である。以下の例では、図4で説明したログイン処理の後でアプリケーションのapp1を利用した場合について説明する。app1では、http://app1.example.com/sso/にアクセスすると、SSO認証が行われるものとする。
Next, a cookie reading process by the
図5に示すように、ブラウザ30は、中継サーバ10経由でhttp://app1.example.com/にアクセスして、http://http-app1-example-com.r.test/にリクエストを送る(ステップS201)。そして、中継サーバ10のリクエスト判別部11は、パス部分の/がCookieHandler.htmlと異なるため、中継部12へリクエスト処理を割り振る。
As shown in FIG. 5, the
そして、中継部12のURI置換部12bは、URIをhttp://app1.example.com/に復元する(ステップS202)。続いて、リクエスト代行部12aは、復元されたURIに対しリクエストを送ると(ステップS203)、Webサーバ20からレスポンスを受信する(ステップS204)。
Then, the URI replacement unit 12b of the
そして、中継サーバ10は、Webサーバ20から返ってきたレスポンスに対してURI置換、クッキー置換、スクリプト追加を行う(ステップS205)。ここでは、レスポンスにはSet-Cookieヘッダやスクリプト中のdocument.cookieへの代入が含まれていないので、クッキー置換を行わない。その後、中継サーバ10は、レスポンスをブラウザ30に送信する(ステップS206)。
Then, the
そして、ブラウザ30は、追加されたスクリプトでiframeを作成する(ステップS207)。app1.example.comの祖先ドメインは、「example.com」の一つだけであり、パスが「/」であるため、作成されるiframeのURIがhttp://http-example-com.r.test/CookieHandler.htmlとなる。そして、ブラウザ内のiframeは、このURIでのリクエストを中継サーバ10に送信して、/CookieHandler.htmlを読み込む(ステップS208)。
Then, the
そして、リクエスト判別部11は、パスが/CookieHandler.htmlであるので、クッキー操作ページ返却部13に処理を割り振る。クッキー操作ページ返却部13は、クッキー操作ページをクライアントに返却する(ステップS209)。続いて、ブラウザの親フレームがiframeに対してクロスドメイン通信でクッキーの取得要求を出す(ステップS210)。iframe側では、クロスドメイン通信の通信元がiframeのドメインの子孫ドメインであることを確認し、document.cookieプロパティを参照してブラウザ30がhttp-example.com.r.testドメインの/パスで保存しているクッキーを読み取る(ステップS211)。例えば、document.cookieを参照することでsid=1234のクッキーを読み取る。
Then, since the path is /CookieHandler.html, the
そして、iframeは、読み取ったクッキーをクロスドメイン通信で親フレームのhttp://http-app1-example-com.r.test/に送信する(ステップS212)。親フレームでは、クロスドメイン通信の通信元が祖先ドメインであるかを確認して、document.cookieプロパティにクッキーの内容を代入する(ステップS213)。これにより、親フレームのドメインで祖先ドメインのクッキーが読めるようになる。また、クッキーの一貫性のためにタイマー等でステップS210〜S213を繰り返し実行する。 The iframe transmits the read cookie to the parent frame http: //http-app1-example-com.r.test/ by cross-domain communication (step S212). In the parent frame, it is confirmed whether the communication source of the cross domain communication is an ancestor domain, and the contents of the cookie are substituted into the document.cookie property (step S213). This allows the ancestor domain cookies to be read in the parent frame domain. Further, for the consistency of cookies, steps S210 to S213 are repeatedly executed by a timer or the like.
そして、ユーザがブラウザ30上に表示されているSSOのためのリンクをクリックすると(ステップS214)、ブラウザ30は、http://http-app1-example-com.r.test/sso/にリクエストを送ろうとする(ステップS215)。ここでは、祖先ドメインのクッキーがコピーされているため、ブラウザ30は、クッキーとしてCookie:sid=1234を付与してリクエストを送る。
When the user clicks the link for SSO displayed on the browser 30 (step S214), the
中継サーバ10のリクエスト判別部11は、リクエストを受信するとき、パスが/sso/であり、/CookieHandler.htmlでないので、中継部12にリクエスト処理を割り振る。中継部12のURI置換部12bがURIをhttp://app1.example.com/sso/と復元し(ステップS216)、リクエスト代行部12aがCookie: sid=1234のヘッダがついたリクエストをhttp://app1.example.com/sso/に送信する(ステップS217)。その後、Webサーバ20では、クッキーのsidの値を見てSSO認証を行うことになる。これによってドメインをまたがったSSO認証が中継サーバ10を介しても正常に行われることになる。
When receiving a request, the
[実施例1の効果]
上述してきたように、中継サーバ10は、Webサーバ20からブラウザ30に対するレスポンスを中継した場合に、リクエストのURIを置換する。そして、中継サーバ10は、Webサーバ20からブラウザ10に対するクッキー書き込み指示情報を受信した場合に、クッキー書き込み指示情報をスクリプトの呼び出し情報に置換する。その後、中継サーバ10は、置換されたスクリプトの呼び出し情報に対して、ブラウザ30のリクエスト先ドメインの祖先ドメインに対応するフレームを作成させるスクリプトを追加する。また、中継サーバ10は、フレームに祖先ドメインに対応するクッキーの書き込み指示をクロスドメイン通信で送信するスクリプトを追加する。このため、中継サーバを経由してブラウザからWebアプリケーションにアクセスする場合であっても、クッキー情報の書き込む処理を適切に実行することが可能である。
[Effect of Example 1]
As described above, when the
また、実施例1によれば、中継サーバ10は、祖先ドメインのフレームのパスのディレクトリをブラウザ30からのレスポンスの受信先フレームのパスのディレクトリと同じにさせるスクリプトをさらに追加する。このため、Set-CookieヘッダやJavaScript中のdocument.cookieへの代入でドメインやパスの指定がある場合にも、iframeのパスのディレクトリを親フレームのパスのディレクトリとそろえる。この結果、祖先ドメインおよび指定パスに該当するクッキー情報の書き込む処理を適切に実行することが可能である。
Further, according to the first embodiment, the
また、実施例1によれば、中継サーバ10は、Webサーバ20からブラウザ30に対するレスポンスを受信する。そして、中継サーバ10は、祖先ドメインに対応するフレームを作成させるとともに該フレームに祖先ドメインのクッキーを取得させて該クッキーをレスポンスの受信先フレームにクロスドメイン通信で送信させるスクリプトを追加する。このため、クッキー情報の読み取り処理を適切に実行することが可能である。
According to the first embodiment, the
また、実施例1によれば、中継サーバ10は、祖先ドメインに対応するフレームに祖先ドメインのクッキーを取得させてクッキーをレスポンスの受信先フレームにクロスドメイン通信で送信させる処理を一定時間ごとに行わせるスクリプトを追加する。このため、祖先ドメインの一貫性を保つことが可能である。
Further, according to the first embodiment, the
ところで、上記の実施例1では、HTMLやJavaScriptにSet-Cookieヘッダが付いている場合に、スクリプトに変換してクッキーの読み書き処理を行う場合を説明したが、本実施例はこれに限定されるものではなく、画像などにSet-Cookieヘッダが付いている場合にも、クッキーの書き込み処理を行う。 By the way, in the above-described first embodiment, the case where HTML / JavaScript has a Set-Cookie header and converted to a script to perform cookie read / write processing has been described. However, the present embodiment is limited to this. Cookie write processing is performed even when a Set-Cookie header is attached to an image or the like.
例えば、ブラウザは、「http://www.example.com/image.jpg」を中継サーバ経由で読みこむために、図7に例示するようなHTTPのリクエストをWebサーバへ送信する。そして、Webサーバは、祖先ドメイン指定のあるクッキー「key=value;domain=.example.com;path=/」をヘッダに付けて、図8に例示するようなレスポンスを中継サーバ経由でブラウザに送信する。 For example, in order to read “http://www.example.com/image.jpg” via the relay server, the browser transmits an HTTP request as illustrated in FIG. 7 to the Web server. Then, the Web server adds a cookie “key = value; domain = .example.com; path = /” with an ancestor domain designation to the header, and sends a response as illustrated in FIG. 8 to the browser via the relay server. To do.
まず最初に、実施例2に係る中継サーバ10Aの構成を説明する。図6に示すように、中継サーバ10Aは、図1に示した中継サーバ10と比較して、画像クッキー処理部14を新たに有する点が相違する。かかる中継サーバ10Aにおいて、画像クッキー処理部14は、URI置換部14a、レスポンス作成部14b、一時保管部14cを有する。
First, the configuration of the
リクエスト判別部11は、実施例1と同様に、リクエストのパスが「/CookieHandler.html」や「/dir1/dir2/CookieHandler.html」となっているリクエストについては、クッキー操作ページ返却部13にリクエストを通知する。また、リクエスト判別部11は、実施例1と同様に、リクエストのパスが「/」や「/CookieHandler.html/dir/」となっているリクエストについては、中継部12へリクエストを通知する。また、リクエスト判別部11は、URIのクエリパラメータにSetCookieWithRedirection=trueを含んでいるリクエストについては、画像クッキー処理部14にリクエストを通知する。
As in the first embodiment, the
URI置換部14aは、Webサーバ20から受信したURIのドメイン部分を置換し、ブラウザ30から受信したURIのドメイン部を復元する。具体的には、URI置換部14aは、Webサーバ20から受信したURIのドメイン部分のドット「.」をハイフン「-」に置換するとともに、中継サーバのホスト名「r.test」を付加する。
The URI replacement unit 14 a replaces the domain part of the URI received from the
レスポンス作成部14bは、クッキー書き込み指示情報に含まれるクッキーを書き込んだ格納先であるURIをリダイレクト先としてブラウザ30に送信する。具体的には、レスポンス作成部14bは、データベースに格納されているcookiesの中から任意のクッキーを一つ取得し、このクッキーをセットできるURIへのリダイレクトをブラウザに送信する。
The response creation unit 14b transmits the URI, which is the storage destination in which the cookie included in the cookie write instruction information is written, to the
そして、レスポンス作成部14bは、ブラウザ30からリダイレクト先に対するリクエストがあった場合には、クッキーをブラウザ30に送信するとともに、リダイレクト先に再度リクエストさせるレスポンスを作成する。そして、レスポンス作成部14bは、ブラウザ30からリダイレクト先に対するリクエストが再度あった場合には、一時保管部14cに格納されたレスポンスボディをブラウザ30に返信する。
Then, when there is a request for the redirect destination from the
一時保管部14cは、サーバからブラウザに対するレスポンスに含まれるレスポンスボディがHTMLやJavaScriptではなく、祖先ドメイン指定のあるクッキー書き込み指示情報が含まれている場合に、クッキー書き込み指示情報に含まれるクッキーおよびレスポンスボディを記憶する。
The
具体的には、一時保管部14cは、図9に示すように、一意に割り当てられた値である「id」、乱数によって生成された値である「token」、後述する図10のresp1rのSet-Cookieヘッダのうち祖先ドメインのドメイン指定のあるクッキーである「cookies」を対応付けて記憶する。また、一時保管部14cは、図9に示すように、画像データのレスポンスボディである「respBody」、ブラウザ30からWebサーバ20へのリクエストのURIを復元したURIである「returnTo」を対応付けて記憶する。
Specifically, the
次に、図10〜図12を用いて、実施例2に係る中継サーバ10Aによる処理を説明する。図10は、実施例2に係る中継サーバ装置による画像クッキー処理の流れを示すシーケンス図である。図11は、実施例2に係る中継サーバ装置による処理の流れを示すフローチャートである。図12は、実施例2に係る中継サーバ装置による処理の流れを示すフローチャートである。
Next, processing performed by the
図10に示すように、ブラウザ30がhttp://www.example.com/image.jpgを中継サーバ経由で読み込むためにhttp://http-www-example-com.r.test/image.jpgにリクエストを送る(ステップS301)。そして、中継サーバ10Aは、リクエストを中継してhttp://www.example.com/image.jpgにリクエストを送る(ステップS302)。
As shown in FIG. 10, in order for the
そして、Webサーバ20は,祖先ドメイン指定のあるクッキーkey=value;domain=.example.com;path=/をヘッダにつけて画像データを返す(ステップS303)。そして、中継サーバ10Aは、HTMLかJavaScriptのクッキーセット指示でなくて、かつ、祖先ドメイン指定があると判定した場合には、中継部12から画像クッキー処理部14に処理を委譲する。そして、画像クッキー処理部14では、一時保管部14cに対して新たな行を追加して、データを書き込む(ステップS304)。
Then, the
その後、レスポンス作成部14bは、一時保管部14cに格納されているcookiesの中から任意のクッキーを一つ取り出す。例えば、図9の例では、cookiesカラムにはクッキーが一つしか格納されていないため、key=value;domain=.example.com; path=/が取り出される。中継サーバ10は、取り出されたクッキーをセットできるURIであるhttp://http-example-com.r.test/?SetCookieWithRedirection=true&id=1234&token=0306へのリダイレクトをブラウザ30に返す(ステップS305)。なお、このURIでSetCookieWithRedirection=trueというクエリパラメータは、実施例1に登場したCookieHandler.htmlと同様に中継サーバが任意に設定できるものである。また、idとtokenのパラメータ名も中継サーバが自由に設定できる。
Thereafter, the response creation unit 14b takes out one arbitrary cookie from the cookies stored in the
ブラウザ30は、http://http-example-com.r.test/?SetCookieWithRedirection=true&id=1234&token=0306にリクエストを送り直す(ステップS306)。中継サーバ10のリクエスト判別部11は、リクエストされたURIのクエリパラメータにSetCookieWithRedirection=trueを含んでいるため画像クッキー処理部14のレスポンス作成部14bに処理を渡す。
The
レスポンス作成部14bは、リクエストのidパラメータとtokenパラメータを取得し両者が一致する行を一時保管部14cから取得する。ステップS306において送信されたリクエストのURIを復元した時のドメインとパスは、example.comと/であり、このドメインとパスで設定することのできるクッキーをcookiesカラムから探すとkey=value;domain=.example.com;path=/が合致する。このため、レスポンス作成部14bは、このクッキーを一時保管部14cから取得してから削除する(ステップS307)。
The response creation unit 14b acquires the id parameter and the token parameter of the request, and acquires a line in which both match from the
そして、中継サーバ10のレスポンス作成部14bは、cookiesカラムに残っているクッキーがなくなったので、returnToカラムの値をURI置換してクエリパラメータを追加する。そして、取得したクッキーをヘッダにつけてURIへのリダイレクトをブラウザに返す(ステップS308)。その後、ブラウザ30は、Set-Cookie:key=value;domain=.http-www-example-com.r.test;path=/のヘッダに従ってexample.comを置換したhttp-www-example-com.r.testドメインでのクッキーセットを行う。
Then, the response creation unit 14b of the
そして、ブラウザ30は、ステップS308で指示されているURIでリクエストを送り直す(ステップS309)。そして、中継サーバ10のリクエスト判別部11は、リクエストパラメータにSetCookieWithRedirection=trueがあるため画像クッキー処理部14に処理を渡す。
Then, the
レスポンス作成部14は、リクエストのidパラメータとtokenパラメータを取得し両者が一致する行を一時保管部14cから取得する。ステップS307においてcookiesカラムが空になっているため、respBodyの値を取得し、一時保管部14cから当該行を削除する(ステップS310)。その後、レスポンス作成部14は、respBodyでレスポンスを作成してブラウザ30に返す(ステップS311)。
The response creation unit 14 acquires the id parameter and the token parameter of the request, and acquires a row in which both match from the
次に、図11および図12を用いて、実施例2に係る中継サーバによる処理の流れを説明する。図11および図12は、実施例2に係る中継サーバ装置による処理の流れを示すフローチャートである。図11に示すように、中継サーバ10Aは、レスポンスを受信すると(ステップS401肯定)、Webサーバ20からのレスポンスがHTMLまたはJavascriptであるか判定する(ステップS402)。
Next, the flow of processing by the relay server according to the second embodiment will be described with reference to FIGS. 11 and 12. FIG. 11 and FIG. 12 are flowcharts illustrating the flow of processing by the relay server device according to the second embodiment. As illustrated in FIG. 11, when the
この結果、中継サーバ装置10Aは、レスポンスがHTMLまたはJavascriptであると判定した場合には(ステップS402肯定)、実施例1で説明したように、クッキーセット指示をsetCookieFunc関数の呼び出しに置換する(ステップS403)。そして、中継サーバ装置10Aは、レスポンスにSet-Cookieヘッダやdocument.cookieへの代入が含まれておらず(ステップS402否定)、Set-Cookieヘッダが付いている場合には、ドメイン指定があるか判定する(ステップS404)。
As a result, when the
この結果、中継サーバ装置10Aは、祖先ドメインの指定がある場合には(ステップS404肯定)、クッキー読み取り処理と行削除処理(後に、図12を用いて詳述)を行う(ステップS405)。また、中継サーバ装置10Aは、祖先ドメインの指定がない場合には(ステップS404否定)、ヘッダにもともとついていたクッキーのドメインを置換する(ステップS406)。
As a result, when the ancestor domain is designated (Yes at Step S404), the
次に、図12を用いて、中継サーバ10Aによるクッキー読み取り処理と行削除処理について説明する。図12に示すように、同一ドメインのクッキーをレスポンスヘッダに追加し(ステップS501)、一時保管部14cに対して新たな行を作成する(ステップS502)。
Next, cookie reading processing and line deletion processing by the
そして、中継サーバ10Aのレスポンス作成部14bは、一時保管部14cのcookiesカラムにクッキーがあるか判定する(ステップS503)。この結果、レスポンス作成部14bは、一時保管部14cのcookiesカラムにクッキーがある場合には(ステップS503肯定)、cookiesカラムからクッキーを一つ取得する(ステップS504)。そして、取得したクッキーをセットできるURIにリダイレクトをブラウザ30に送信する(ステップS505)。
Then, the response creation unit 14b of the
その後、中継サーバ10Aは、次のリクエストを待った後(ステップS506)、cookiesカラムにあるクッキーのうち現在のURIでセットできるクッキーをすべて取得し、当該クッキーをカラムから削除してレスポンスヘッダに追加する(ステップS507)。そして、ステップS503に戻って、一時保管部14cのcookiesカラムにクッキーがなくなるまでステップS504〜S507の処理を繰り返す。その後、一時保管部14cのcookiesカラムにクッキーがなくなると(ステップS503否定)、returnToカラムの値を取得する(ステップS508)。
Thereafter, after waiting for the next request (step S506), the
そして、取得したクッキーをヘッダにつけてURIへのリダイレクトをブラウザに返す(ステップS509)。その後、中継サーバ10は、リクエストを待った後(ステップS510)、リクエストのidパラメータとtokenパラメータを取得して両者が一致する行を一時保管部14cから取得してrespBodyの値を読み出し、当該行を削除する(ステップS511)。
Then, the acquired cookie is attached to the header and a redirect to the URI is returned to the browser (step S509). Thereafter, the
このように実施例2によれば、中継サーバ10Aは、Webサーバ20からブラウザ30に対するレスポンスに含まれるレスポンスボディがHTMLかJavaScriptではなくクッキー書き込み指示情報が含まれている場合に、クッキー書き込み指示情報に含まれるクッキーおよびレスポンスボディを一時保管部14cに格納する。そして、中継サーバ10Aは、クッキー書き込み指示情報に含まれるクッキーを書き込んだURIをリダイレクト先としてブラウザ30に送信する。続いて、中継サーバ10Aは、ブラウザ30からリダイレクト先に対するリクエストがあった場合には、クッキーをブラウザ30に送信するとともに、リダイレクト先に再度リクエストさせるレスポンスを作成する。その後、中継サーバ10Aは、ブラウザ30からリダイレクト先に対するリクエストが再度あった場合には、一時保管部14cに格納されたレスポンスボディをブラウザ30に返信する。このため、中継サーバ10Aは、画像などにSet-Cookieが付いている場合であっても、ブラウザ30にクッキーを適切に処理させることが可能となる。
As described above, according to the second embodiment, when the response body included in the response from the
さて、これまで実施例1、2について説明したが、上述した実施例以外にも、種々の異なる形態にて実施されてよいものである。そこで、以下では実施例3として他の実施例を説明する。 Although the first and second embodiments have been described so far, the present invention may be implemented in various different forms other than the above-described embodiments. Therefore, another embodiment will be described below as a third embodiment.
(1)システム構成等
また、図示した各装置の各構成要素は機能概念的なものであり、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各装置の分散・統合の具体的形態は図示のものに限られず、その全部または一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的または物理的に分散・統合して構成することができる。例えば、スクリプト追加部12dを書込スクリプト追加部と読取スクリプト追加部とに分散してもよい。さらに、各装置にて行なわれる各処理機能は、その全部または任意の一部が、CPUおよび当該CPUにて解析実行されるプログラムにて実現され、あるいは、ワイヤードロジックによるハードウェアとして実現され得る。
(1) System Configuration, etc. Further, each component of each illustrated apparatus is functionally conceptual and does not necessarily need to be physically configured as illustrated. In other words, the specific form of distribution / integration of each device is not limited to that shown in the figure, and all or a part thereof may be functionally or physically distributed or arbitrarily distributed in arbitrary units according to various loads or usage conditions. Can be integrated and configured. For example, the
(2)プログラム
図1の中継サーバ10の処理をプログラムにより実行する場合、図13に示すような情報処理装置(コンピュータ)が用いられる。図13の情報処理装置は、Central Processing Unit(CPU)1401、メモリ1402、入力装置1403、出力装置1404、外部記憶装置1405、媒体駆動装置1406、およびネットワーク接続装置1407を有し、互いに接続されている。
(2) Program When the processing of the
メモリ1402は、例えば、Read Only Memory(ROM)、Random Access Memory(RAM)等を含み、処理に用いられるプログラムおよびデータを格納する。CPU1401は、メモリ1402を利用してプログラムを実行することにより、中継サーバと同様の処理を行う。
The memory 1402 includes, for example, a read only memory (ROM), a random access memory (RAM), and the like, and stores programs and data used for processing. The
入力装置1403は、例えば、キーボード、ポインティングデバイス等であり、オペレータからの指示や情報の入力に用いられる。出力装置1404は、例えば、ディスプレイ、プリンタ、スピーカ等であり、オペレータへの問い合わせや処理結果の出力に用いられる。
The
外部記憶装置1405は、例えば、磁気ディスク装置、光ディスク装置、光磁気ディスク装置、テープ装置等である。情報処理装置は、この外部記憶装置1405に、プログラムおよびデータを格納しておき、必要に応じて、それらをメモリ1402にロードして使用する。
The
媒体駆動装置1406は、可搬記録媒体1408を駆動し、その記録内容にアクセスする。可搬記録媒体1408は、メモリカード、フレキシブルディスク、光ディスク、光磁気ディスク等の任意のコンピュータ読み取り可能な記録媒体である。オペレータは、この可搬記録媒体1408にプログラムおよびデータを格納しておき、必要に応じて、それらをメモリ1402にロードして使用する。
The
ネットワーク接続装置1407は、インターネット等の通信ネットワークに接続され、クライアント及び各目的サーバとの通信に伴うデータ変換を行う。また、情報処理装置は、必要に応じて、プログラムおよびデータを外部の装置からネットワーク接続装置1407を介して受け取り、それらをメモリ1402にロードして使用する。
The
10、10A 中継サーバ
11 リクエスト判別部
12 中継部
12a リクエスト代行部
12b URI置換部
12c クッキー置換部
12d スクリプト追加部
13 クッキー操作ページ返却部
14 画像クッキー処理部
14a URI置換部
14b レスポンス作成部
14c 一時保管部
10,
Claims (7)
前記サーバから前記ブラウザに対するクッキー書き込み指示情報を受信した場合に、該クッキー書き込み指示情報をスクリプトの呼び出し情報に置換するクッキー置換部と、
前記クッキー置換部によって置換されたスクリプトの呼び出し情報に対して、前記ブラウザのリクエスト先ドメインの祖先ドメインに対応するフレームを作成させるとともに祖先ドメインに対応するクッキーの書き込み指示をクロスドメイン通信で前記フレームへ送信させるスクリプトを追加する書込スクリプト追加部と、
を有することを特徴とする中継サーバ装置。 A resource identifier replacement unit that replaces the resource identifier of the request when a response from the server to the browser is relayed;
A cookie replacement unit that replaces the cookie writing instruction information with script call information when receiving the cookie writing instruction information for the browser from the server;
For the script call information replaced by the cookie replacement unit, a frame corresponding to the ancestor domain of the request destination domain of the browser is created, and a cookie write instruction corresponding to the ancestor domain is transmitted to the frame by cross-domain communication. A writing script adding unit for adding a script to be transmitted;
A relay server device characterized by comprising:
前記クッキー書き込み指示情報に含まれるクッキーを書き込んだ格納先情報をリダイレクト先として前記ブラウザに送信するリダイレクト先送信部と、
前記ブラウザから前記リダイレクト先に対するリクエストがあった場合には、前記クッキーをブラウザに送信するとともに、前記リダイレクト先に再度リクエストさせるレスポンスを作成するレスポンス作成部と、
前記ブラウザから前記リダイレクト先に対するリクエストが再度あった場合には、前記記憶部に格納されたレスポンスボディを前記ブラウザに返信するレスポンスボディ返信部と、
をさらに有することを特徴とする請求項1〜4のいずれか一つに記載の中継サーバ装置。 When the response body included in the response from the server to the browser is image information and includes cookie write instruction information, the cookie storage stores the cookie and response body included in the cookie write instruction information in the storage unit And
A redirect destination transmission unit that transmits the storage destination information in which the cookie included in the cookie writing instruction information is written to the browser as a redirect destination;
When there is a request for the redirect destination from the browser, the cookie is transmitted to the browser, and a response creation unit that creates a response to request the redirect destination again;
When there is a request for the redirect destination from the browser again, a response body reply unit that returns the response body stored in the storage unit to the browser;
The relay server device according to claim 1, further comprising:
前記サーバから前記ブラウザに対するクッキー書き込み指示情報を受信した場合に、該クッキー書き込み指示情報をスクリプトの呼び出し情報に置換するクッキー置換ステップと、
前記クッキー置換ステップによって置換されたスクリプトの呼び出し情報に対して、前記ブラウザのリクエスト先ドメインの祖先ドメインに対応するフレームを作成させるとともに該フレームに祖先ドメインに対応するクッキーの書き込み指示をクロスドメイン通信で送信するスクリプトを追加する書込スクリプト追加ステップと、
を含んだことを特徴とするクッキー制御方法。 A URI replacement step for replacing the resource identifier of the request when a request for the server is received from the browser;
A cookie replacement step of replacing the cookie write instruction information with script call information when receiving cookie write instruction information for the browser from the server;
For the script call information replaced by the cookie replacement step, a frame corresponding to the ancestor domain of the request destination domain of the browser is created and a cookie write instruction corresponding to the ancestor domain is transmitted to the frame by cross-domain communication. A writing script adding step for adding a script to be transmitted;
Cookie control method characterized by including.
前記サーバから前記ブラウザに対するクッキー書き込み指示情報を受信した場合に、該クッキー書き込み指示情報をスクリプトの呼び出し情報に置換するクッキー置換手順と、
前記クッキー置換手順によって置換されたスクリプトの呼び出し情報に対して、前記ブラウザのリクエスト先ドメインの祖先ドメインに対応するフレームを作成させるとともに該フレームに祖先ドメインに対応するクッキーの書き込み指示をクロスドメイン通信で送信するスクリプトを追加する書込スクリプト追加手順と、
をコンピュータに実行させることを特徴とするクッキー制御プログラム。 A URI replacement procedure for replacing the resource identifier of the request when a request for the server is received from the browser;
A cookie replacement procedure for replacing the cookie write instruction information with script call information when receiving cookie write instruction information for the browser from the server;
For the script call information replaced by the cookie replacement procedure, a frame corresponding to the ancestor domain of the request destination domain of the browser is created and a cookie write instruction corresponding to the ancestor domain is transmitted to the frame by cross-domain communication. Write script addition procedure to add the script to send,
A cookie control program for causing a computer to execute.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010129428A JP5581820B2 (en) | 2010-06-04 | 2010-06-04 | Relay server device, cookie control method, and cookie control program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010129428A JP5581820B2 (en) | 2010-06-04 | 2010-06-04 | Relay server device, cookie control method, and cookie control program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2011257810A true JP2011257810A (en) | 2011-12-22 |
JP5581820B2 JP5581820B2 (en) | 2014-09-03 |
Family
ID=45473964
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010129428A Expired - Fee Related JP5581820B2 (en) | 2010-06-04 | 2010-06-04 | Relay server device, cookie control method, and cookie control program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5581820B2 (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013109620A (en) * | 2011-11-22 | 2013-06-06 | Nippon Telegr & Teleph Corp <Ntt> | Information system and authentication state management method thereof |
CN104486458A (en) * | 2014-12-15 | 2015-04-01 | 北京国双科技有限公司 | Cross-domain session data processing method and device |
JP2016509277A (en) * | 2012-12-13 | 2016-03-24 | クアルコム,インコーポレイテッド | Loading a redirected web page in a web browser of a client device in a communication system |
JP2016537696A (en) * | 2013-09-20 | 2016-12-01 | オラクル・インターナショナル・コーポレイション | Web-based single sign-on with a formfill proxy application |
JP2017504092A (en) * | 2013-11-11 | 2017-02-02 | アダロム・インコーポレイテッド | Cloud service security broker and proxy |
JP2017194843A (en) * | 2016-04-20 | 2017-10-26 | ヤフー株式会社 | Transfer device, transfer method, and transfer program |
US10324702B2 (en) | 2014-09-12 | 2019-06-18 | Microsoft Israel Research And Development (2002) Ltd. | Cloud suffix proxy and a method thereof |
RU2751436C1 (en) * | 2020-10-14 | 2021-07-13 | Общество С Ограниченной Ответственностью "Группа Айби" | Method and system for dynamic global identification of user's environment |
CN110209959B (en) * | 2018-02-11 | 2024-01-12 | 北京京东尚科信息技术有限公司 | Information processing method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004094805A (en) * | 2002-09-03 | 2004-03-25 | Internatl Business Mach Corp <Ibm> | Network system, reverse proxy, computer device, deta processing method and program |
JP2004318816A (en) * | 2003-03-31 | 2004-11-11 | Toshiba Corp | Communication relay device, communication relay method, and program |
JP2008242684A (en) * | 2007-03-27 | 2008-10-09 | Fujitsu Ltd | Method and system for authentication processing |
JP2009031852A (en) * | 2007-07-24 | 2009-02-12 | Yamaha Corp | Relay device, relay method, and program |
JP2009271676A (en) * | 2008-05-02 | 2009-11-19 | Fujitsu Ltd | Web information relaying method and apparatus |
JP2010079431A (en) * | 2008-09-24 | 2010-04-08 | Hitachi Software Eng Co Ltd | Information leakage prevention program |
-
2010
- 2010-06-04 JP JP2010129428A patent/JP5581820B2/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004094805A (en) * | 2002-09-03 | 2004-03-25 | Internatl Business Mach Corp <Ibm> | Network system, reverse proxy, computer device, deta processing method and program |
JP2004318816A (en) * | 2003-03-31 | 2004-11-11 | Toshiba Corp | Communication relay device, communication relay method, and program |
JP2008242684A (en) * | 2007-03-27 | 2008-10-09 | Fujitsu Ltd | Method and system for authentication processing |
JP2009031852A (en) * | 2007-07-24 | 2009-02-12 | Yamaha Corp | Relay device, relay method, and program |
JP2009271676A (en) * | 2008-05-02 | 2009-11-19 | Fujitsu Ltd | Web information relaying method and apparatus |
JP2010079431A (en) * | 2008-09-24 | 2010-04-08 | Hitachi Software Eng Co Ltd | Information leakage prevention program |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013109620A (en) * | 2011-11-22 | 2013-06-06 | Nippon Telegr & Teleph Corp <Ntt> | Information system and authentication state management method thereof |
KR101756567B1 (en) | 2012-12-13 | 2017-07-10 | 퀄컴 인코포레이티드 | Loading a re-directed web page on a web browser of a client device in a communications system |
JP2016509277A (en) * | 2012-12-13 | 2016-03-24 | クアルコム,インコーポレイテッド | Loading a redirected web page in a web browser of a client device in a communication system |
JP2016510445A (en) * | 2012-12-13 | 2016-04-07 | クアルコム,インコーポレイテッド | Loading redirected web resources in a web browser on a client device in a communication system |
US10693865B2 (en) | 2013-09-20 | 2020-06-23 | Oracle International Corporation | Web-based interface integration for single sign-on |
US10225244B2 (en) | 2013-09-20 | 2019-03-05 | Oracle International Corporation | Web-based interface integration for single sign-on |
JP2016537696A (en) * | 2013-09-20 | 2016-12-01 | オラクル・インターナショナル・コーポレイション | Web-based single sign-on with a formfill proxy application |
JP2017504092A (en) * | 2013-11-11 | 2017-02-02 | アダロム・インコーポレイテッド | Cloud service security broker and proxy |
US10324702B2 (en) | 2014-09-12 | 2019-06-18 | Microsoft Israel Research And Development (2002) Ltd. | Cloud suffix proxy and a method thereof |
US10642600B2 (en) | 2014-09-12 | 2020-05-05 | Microsoft Technology Licensing, Llc. | Cloud suffix proxy and a method thereof |
CN104486458A (en) * | 2014-12-15 | 2015-04-01 | 北京国双科技有限公司 | Cross-domain session data processing method and device |
JP2017194843A (en) * | 2016-04-20 | 2017-10-26 | ヤフー株式会社 | Transfer device, transfer method, and transfer program |
CN110209959B (en) * | 2018-02-11 | 2024-01-12 | 北京京东尚科信息技术有限公司 | Information processing method and device |
RU2751436C1 (en) * | 2020-10-14 | 2021-07-13 | Общество С Ограниченной Ответственностью "Группа Айби" | Method and system for dynamic global identification of user's environment |
US11218551B1 (en) | 2020-10-14 | 2022-01-04 | Group Ib, Ltd | Method and system for user identification based on user environment |
Also Published As
Publication number | Publication date |
---|---|
JP5581820B2 (en) | 2014-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5581820B2 (en) | Relay server device, cookie control method, and cookie control program | |
JP6323994B2 (en) | Content management apparatus, content management method and program | |
JP2005321970A (en) | Computer system | |
US20020032781A1 (en) | Intermediary server apparatus and an information providing method | |
JP5437785B2 (en) | Authentication method, conversion device, relay device, and program | |
JP2015219687A (en) | Relay device, system, and program | |
JP2011013707A (en) | Web page relay apparatus | |
JP2010102625A (en) | Method and device for rewriting uniform resource locator | |
JP2017142619A (en) | Api cooperation device, api cooperation method, and api cooperation program | |
JP2005346570A (en) | Authentication system, authentication method and computer program | |
JP6197286B2 (en) | Communication device, information processing system, and information processing system control method | |
KR20020017622A (en) | Community service system in internet environment and method thereof | |
JP2009123062A (en) | System and method for content display control | |
JP2008065814A (en) | Information access control method | |
JP2012058898A (en) | Web service providing system, server device, method and program | |
JP2001356983A (en) | Information disclosure restriction system | |
JP2009251754A (en) | Page customizing server, page customizing program, and page customizing method | |
JP2010039763A (en) | Server system | |
US7835896B1 (en) | Apparatus for evaluating and demonstrating electronic circuits and components | |
JP6413540B2 (en) | Relay device, data processing system, and program | |
JP2002236662A (en) | Information processing system and authentication server program | |
JP2014241113A (en) | Content management device, content management system, content management method, and program | |
JP7119797B2 (en) | Information processing device and information processing program | |
JP2007018383A (en) | Release information disclosing system | |
JP2006146298A (en) | System and method for adjusting timeout period for application, server apparatus and its program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20130403 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20140121 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140204 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140407 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20140617 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20140630 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5581820 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |