Forums: Open Discussion (Thread #25218)

同一セッションを判断する方法(rich) (2010-01-25 15:02 by udonsoba0315 #48101)

お世話になっております。

現在クライアントにTERASOLUNA Client FW for .NET、サーバ側にTERASOLUNA Server FW for Java (Rich版)
を採用してシステムを設計しておりますが、ユーザ認証情報をどこに持たせるべきか悩んでいます。
Rich版はサーバ側でセッション情報を保持しないということでしたので、SpringのセッションスコープBeanやHttpSessionを使用することもできず、代替案としてクライアントでユーザ情報などを持たせておいて都度認証する方法を考えたのですが、もっと効率のよい方法があればご教授いただけないでしょうか。よろしくお願いします。

Reply to #48101×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 同一セッションを判断する方法(rich) (2010-01-26 15:50 by udonsoba0315 #48117)

自己レスですが、クライアントでユーザ情報を持たせてリクエストの都度認証する方式は、非常にセキュリティ的に危ういですね。リッチ版FWはリクエスト名とXML電文のみで通信できてしまうので、いくらでも偽装できそうです。
もう一つ考えた方法としてはかなりの手間になりますが、ログイン時にユーザごとにセッション情報に相当する情報をDBに確保して、トークンキーを自前で払いだして持ちまわる形でしょうか。これも安全とは言い難いですが…。

フレームワークとして、認証を前提としたシステムではどのようにすべきかのノウハウがございましたら、教えていただけるとありがたいです。よろしくお願いします。
Reply to #48101

Reply to #48117×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 同一セッションを判断する方法(rich) (2010-01-26 18:01 by sejimos #48120)

ご承知の通り、TERASOLUNAではステートレスなリッチクライアントを
想定しています。ステートレスなリッチクライアントにおける認証方式
としては、ご本人も検討されている「リクエストの都度認証する方法」や
「セッションを利用する方法」をよく目にします。

前者の場合、TERASOLUNAの標準機能としてリクエストのヘッダに任意の
ユーザ情報を設定する仕組みが用意されており、サーバ側のフィルタによる
認証を行うことで比較的容易に実装できます。
一方、後者の場合、TERASOLUNAの標準機能ではクッキーを管理しないため、
独自にクッキー管理の仕組みを作り込む必要があります。

ノウハウとして広くご紹介できる情報を持ち合わせておりませんが、
"サーバでセッション情報を保持しない"という観点で、Webサービスでの
認証方式が参考になるのではないでしょうか。
外部のソースになりますが、参考までにご紹介します。
[@IT XML Webサービスのセキュリティ実装]
<http://www.atmarkit.co.jp/fdotnet/hybooks/vbnet01/vbnet01_01.html>
Reply to #48117

Reply to #48120×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 同一セッションを判断する方法(rich) (2010-01-27 17:01 by udonsoba0315 #48133)

お返事ありがとうございます。

クッキー管理の仕組み作りこみはコストとセキュリティ要件の見合いで検討したいと思います。
ところで、リクエストにヘッダに任意の値を設定するというのは「DataSetXmlCommunicator」を使った直接通信方式のことでしょうか。「EventController」を用いた通信方式でも使用できるのでしょうか。

よろしくお願いします。
Reply to #48120

Reply to #48133×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 同一セッションを判断する方法(rich) (2010-01-27 17:11 by sejimos #48134)

EventController.Itemsプロパティに"RequestHeaders"をキーとしてIDictionary<string,string>型の
ディクショナリを設定すると、そのディクショナリの値が通信時にヘッダとしてサーバへ送信されます。
それ以外の値はクライアント側ビジネスロジックに渡っていますが、サーバへは送信されません。
Reply to #48133

Reply to #48134×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 同一セッションを判断する方法(rich) (2010-01-28 14:31 by udonsoba0315 #48152)

リクエストヘッダにCookie属性を追加することでサーバ側で同一セッションとして認識されました。

あとはログイン時にセッションIDを返却する部分なのですが、レスポンスヘッダで返却しようと考えています。
機能説明書で、レスポンスヘッダを参照するのはCommunicationResultであればResponseHeadersで参照可能と書いてありますが、ExecutionResultでは取得する方法はありますか?

よろしくお願いします。
Reply to #48134

Reply to #48152×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 同一セッションを判断する方法(rich) (2010-01-28 18:36 by sejimos #48163)

過去のこちらスレッドを参考にしていただけますか?
http://sourceforge.jp/forum/message.php?msg_id=39186
Reply to #48152

Reply to #48163×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 同一セッションを判断する方法(rich) (2010-01-29 14:19 by udonsoba0315 #48171)

ご紹介ありがとうございました。
無事動作させることができました。
Reply to #48163

Reply to #48171×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 同一セッションを判断する方法(rich) (2010-01-27 17:55 by udonsoba0315 #48138)

確認できました。ありがとうございます。
Reply to #48101

Reply to #48138×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login