WebSphere Application Server for z/OS, Version 6.0.x   
             オペレーティング・システム: z/OS

             目次と検索結果のパーソナライズ化

例: スレッド上の RunAs サブジェクトのオーバーライド

Java Authentication and Authorization Service (JAAS) のアプリケーション・プロ グラミング・インターフェース (API) で提供されている機能を拡張するためには、RunAs サブジェクトまたは呼び出しサブジェクトに、 この実行スレッド上のアウトバウンド要求に使用される別の有効なエントリーを設定します。

この拡張機能により、WSSubject.doAs メソッドを使用して サブジェクトをリモート・アクションに関連付けるかどうかにかかわらず、 このスレッド上のすべてのリモート呼び出しに対するサブジェクトの関連付けが柔軟に行えるようになります。 以下に例を示します。

try
{
javax.security.auth.Subject runas_subject, caller_subject;

runas_subject = com.ibm.websphere.security.auth.WSSubject.getRunAsSubject();
caller_subject = com.ibm.websphere.security.auth.WSSubject.getCallerSubject();

// set a new RunAs subject for the thread, overriding the one declaratively set
com.ibm.websphere.security.auth.WSSubject.setRunAsSubject(caller_subject);

// do some remote calls

// restore back to the previous runAsSubject
com.ibm.websphere.security.auth.WSSubject.setRunAsSubject(runas_subject);
}
catch (WSSecurityException e)
{
// log error
}
catch (Exception e)
{
// log error
}

アプリケーション開発者は、WSSubject.doAs メソッドを 使用して、JAAS サブジェクトを設定できます。 このサブジェクトは、JAAS ログイン・モジュールによって、WebSphere Application Server ランタイムが 指定のアクションを実行する際に使用する、 アクティブ・セキュリティー ID として認証されます。 WSSubject.doAs は、sync-to-thread に対して構成されたコンポーネント内で呼び出されたときのみスレッド ID と同期します。 アプリケーションの「Synch to OS Thread Allowed」オプションと併用する場合、 この ID は、そのアクションの有効範囲に対応するオペレーティング・システムのスレッド上に設定されます。

これらの API を実行するには、以下の Java 2 セキュリティー許可が必要です。
  • permission javax.security.auth.AuthPermission "wssecurity.getRunAsSubject"
  • permission javax.security.auth.AuthPermission "wssecurity.getCallerSubject"
  • permission javax.security.auth.AuthPermission "wssecurity.setRunAsSubject"



関連概念
Java スレッド ID とオペレーティング・システム・スレッド ID
関連タスク
Java Authentication and Authorization Service によるアプリケーション・ログインの カスタマイズ
関連資料
認証プロトコルのサポート
サーバー・サイドの Java Authentication and Authorization Service の認証およびログイン構成のカスタマイズ
参照トピック    

ご利用条件 | フィードバック

最終更新: Jan 21, 2008 10:52:11 PM EST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/rsec_override.html