| Oracle® Fusion Middleware Oracle Security Developer Toolsリファレンス 11gリリース1(11.1.1) B61386-01 | 
 | 
|  戻る |  次へ | 
Liberty Allianceは、個人および企業が貴重なアイデンティティ情報のプライバシやセキュリティを危険にさらすことなく、ほとんどすべてのトランザクションを実行できるようにすることを目標に設立されたオープンな組織です。Liberty Allianceによって発行された仕様は、オープンなアイデンティティ・フェデレーション・フレームワークに基づいています。このような仕様により、業務提携する企業は、組織をまたがるフェデレーテッド・ネットワーク・アイデンティティ・モデルに基づいた業務関係を形成できるようになります。
この章では、Oracle Liberty SDKの機能と利点、Oracle Liberty SDKの環境設定および使用方法について説明します。
この章に含まれる内容は次のとおりです。
Java開発者は、Oracle Liberty SDKを使用して、シングル・サインオン(SSO)およびフェデレーテッド・アイデンティティ管理(FIM)ソリューションを設計および開発することができます。Oracle Liberty SDKは、Liberty Alliance ID-FF 1.1および1.2の仕様に準拠するシステムの開発と統合のあらゆる面の統一、単純化および拡張を目的としています。
Oracle Liberty SDK 1.1および1.2では、直観的でわかりやすいJava APIを使用することでソフトウェア開発の単純化が実現されています。このツールキットによって、Liberty Alliance仕様に準拠するソリューションの開発を支援するツール、情報およびサンプルが提供されます。また、ツールキットは、アプレット、アプリケーション、EJB、サーブレット、JSPなど、あらゆる既存のJavaソリューションに透過的に統合できます。
Oracle Liberty SDKは、次の機能を提供するPure Javaソリューションです。
Liberty Alliance ID-FFバージョン1.1および1.2仕様のサポート
Libertyベースのシングル・サインオンおよびフェデレーテッド・アイデンティティ・プロトコルのサポート
SAML 1.0/1.1仕様のサポート
この項では、Oracle Liberty 1.1を使用するための環境設定、およびOracle Liberty 1.1のクラスとインタフェースについて説明します。この項に含まれる内容は次のとおりです。
Oracleセキュリティ開発ツールは、Oracle Application ServerとともにORACLE_HOMEにインストールされます。
この項では、Oracle Liberty 1.1を使用するための環境設定について説明します。この項に含まれる内容は次のとおりです。
Oracle Liberty 1.1を使用するには、システムにJava Development Kit(JDK)バージョン1.5以上が必要です。
CLASSPATH環境変数には、必要なjarファイルおよびclassファイルすべてのフルパスとファイル名を指定してください。次の項目をCLASSPATHに指定します。
osdt_core.jar
osdt_cert.jar
osdt_xmlsec.jar
osdt_saml.jar
org.jaxen_1.1.1.jarファイル(Oracle XML Securityディストリビューションに含まれるJaxen XPathエンジン)
osdt_lib_v11.jarファイル
WindowsでCLASSPATHを設定する手順を次に示します。
Windowsの「コントロール パネル」で「システム」を選択します。
「システムのプロパティ」ダイアログで「詳細設定」タブを選択します。
「環境変数」をクリックします。
ユーザー環境変数のセクションで「新規」をクリックし、CLASSPATH環境変数をユーザー・プロファイルに追加します。CLASSPATH環境変数がすでに存在している場合は、選択して「編集」をクリックします。
必要なjarファイルすべてのフルパスとファイル名をCLASSPATHに追加します。
たとえば、CLASSPATHは次のようになります。
%CLASSPATH%;%ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_core.jar; %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_cert.jar; %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_xmlsec.jar; %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_saml.jar; %ORACLE_HOME%\modules\org.jaxen_1.1.1.jar; %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_lib_v11.jar;
「OK」をクリックします。
UNIXでCLASSPATHを設定するには、必要なjarファイルおよびclassファイルすべてのフルパスとファイル名を含むようにCLASSPATH環境変数を設定します。次に例を示します。
setenv CLASSPATH $CLASSPATH:$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_core.jar: $ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_cert.jar: $ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_xmlsec.jar: $ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_saml.jar: $ORACLE_HOME/modules/org.jaxen_1.1.1.jar: $ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_lib_v11.jar
この項では、Oracle Liberty SDKリリース1.1の有用なクラスとインタフェースの一部を示します。この項に含まれる内容は次のとおりです。
この項では、Oracle Liberty SDKリリース1.1のコア・クラスとインタフェースについて説明します。
コア・クラスを次に示します。
oracle.security.xmlsec.liberty.v11.FederationTerminationNotificationクラス
oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierRequestクラス
oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierResponseクラス
このクラスは、Libertyプロトコル・スキーマのAuthnRequest要素を表します。
例11-1に、新しいAuthnRequest要素を作成して文書に追加する方法を示します。
例11-1 AuthnRequest要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
AuthnRequest authnRequest = new AuthnRequest(doc);
doc.getDocumentElement().appendChild(authnRequest);
例11-2に、AuthnRequest要素をXML文書から取得する方法を示します。
例11-2 文書からのAuthnRequest要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all AuthnRequest elements in the document.
NodeList arList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "AuthnRequest"); 
if (arList.getLength() == 0)
    System.err.println("No AuthnRequest elements found.");
 
// Convert each org.w3c.dom.Node object to an
// oracle.security.xmlsec.liberty.v11.AuthnRequest object and process
for (int s = 0, n = arList.getLength(); s < n; ++s)
{
    AuthnRequest authnRequest = 
        new AuthnRequest((Element)arList.item(s)); 
    // Process AuthnRequest element
    ...
}
このクラスは、Libertyプロトコル・スキーマのAuthnResponse要素を表します。
例11-3に、新しいAuthnResponse要素を作成して文書に追加する方法を示します。
例11-3 AuthnResponse要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
AuthnResponse authnResponse = new AuthnResponse(doc);
doc.getDocumentElement().appendChild(authnResponse);
例11-4に、AuthnResponse要素をXML文書から取得する方法を示します。
例11-4 文書からのAuthnResponse要素の取得
Document doc = Instance of org.w3c.dom.Document;
// Get list of all AuthnResponse elements in the document.
NodeList arList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "AuthnResponse");
if (arList.getLength() == 0)
    System.err.println("No AuthnResponse elements found.");
 
// Convert each org.w3c.dom.Node object to an
// oracle.security.xmlsec.liberty.v11.AuthnResponse object and process
for (int s = 0, n = arList.getLength(); s < n; ++s)
{
    AuthnResponse authnResponse = 
        new AuthnResponse((Element)arList.item(s)); 
    // Process AuthnResponse element
    ...
}
このクラスは、Libertyプロトコル・スキーマのFederationTerminationNotification要素を表します。
例11-5に、新しいフェデレーション終了通知要素を作成して文書に追加する方法を示します。
例11-5 FederationTerminationNotification要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
FederationTerminationNotification ftn = 
    new FederationTerminationNotification(doc);
doc.getDocumentElement().appendChild(ftn);
例11-6に、フェデレーション終了通知要素をXML文書から取得する方法を示します。
例11-6 文書からのFederationTerminationNotification要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all FederationTerminationNotification elements in the document
         NodeList ftnList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty, 
    "FederationTerminationNotification");
if (ftnList.getLength() == 0)
    System.err.println("No FederationTerminationNotification elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.liberty.v11.FederationTerminationNotification 
// object and process
for (int s = 0, n = ftnList.getLength(); s < n; ++s)
{
    FederationTerminationNotification ftn =
         new FederationTerminationNotification((Element)ftnList.item(s));
    // Process FederationTerminationNotification element
    ...
}
このクラスは、Libertyプロトコル・スキーマのLogoutRequest要素を表します。
例11-7に、新しいLogoutRequest要素を作成して文書に追加する方法を示します。
例11-7 LogoutRequest要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
LogoutRequest lr = new LogoutRequest(doc);
doc.getDocumentElement().appendChild(lr);
例11-8に、LogoutRequest要素をXML文書から取得する方法を示します。
例11-8 XML文書からのLogoutRequest要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all LogoutRequest elements in the document.
NodeList lrList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty, 
    "LogoutRequest");
if (lrList.getLength() == 0)
    System.err.println("No LogoutRequest elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.liberty.v11.LogoutRequest
// object and process
for (int s = 0, n = lrList.getLength(); s < n; ++s)
{
    LogoutRequest lr = new LogoutRequest((Element)lrList.item(s));
    // Process LogoutRequest element
    ...
}
このクラスは、Libertyプロトコル・スキーマのLogoutResponse要素を表します。
例11-9に、新しいLogoutResponse要素を作成して文書に追加する方法を示します。
例11-9 LogoutResponse要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
LogoutResponse lr = new LogoutResponse(doc);
doc.getDocumentElement().appendChild(lr);
例11-10に、LogoutResponse要素をXML文書から取得する方法を示します。
例11-10 文書からのLogoutResponse要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all LogoutResponse elements in the document.
NodeList lrList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "LogoutResponse");
if (lrList.getLength() == 0)
    System.err.println("No LogoutResponse elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.liberty.v11.LogoutResponse
// object and process
for (int s = 0, n = lrList.getLength(); s < n; ++s)
{
    LogoutResponse lr = new LogoutResponse((Element)lrList.item(s));
                        
    // Process LogoutResponse element
    ...
}
このクラスは、Libertyプロトコル・スキーマのRegisterNameIdentifierRequest要素を表します。
例11-11に、新しいRegisterNameIdentifierRequest要素を作成して文書に追加する方法を示します。
例11-11 RegisterNameIdentifierRequest要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierRequest rnir = 
    new RegisterNameIdentifierRequest(doc);
doc.getDocumentElement().appendChild(rnir);
例11-12に、RegisterNameIdentifierRequest要素をXML文書から取得する方法を示します。
例11-12 XML文書からのRegisterNameIdentifierRequest要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all RegisterNameIdentifierRequest elements in the document
NodeList rnirList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty, 
    "RegisterNameIdentifierRequest");
if (rnirList.getLength() == 0)
    System.err.println("No RegisterNameIdentifierRequest elements found.");
 
// Convert each org.w3c.dom.Node object to an 
//oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierRequest
// object and process
for (int s = 0, n = rnirList.getLength(); s < n; ++s)
{
    RegisterNameIdentifierRequest rnir = new 
        RegisterNameIdentifierRequest((Element)rnirList.item(s));
                        
    // Process RegisterNameIdentifierRequest element
    ...
}
このクラスは、Libertyプロトコル・スキーマのRegisterNameIdentifierResponse要素を表します。
例11-13に、新しいRegisterNameIdentifierResponse要素を作成して文書に追加する方法を示します。
例11-13 RegisterNameIdentifierResponse要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierResponse rnir = new RegisterNameIdentifierResponse(doc);
doc.getDocumentElement().appendChild(rnir);
例11-14に、RegisterNameIdentifierResponse要素をXML文書から取得する方法を示します。
例11-14 XML文書からのRegisterNameIdentifierResponse要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all RegisterNameIdentifierResponse elements in the document
NodeList rnirList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty, 
    "RegisterNameIdentifierResponse");
if (rnirList.getLength() == 0)
    System.err.println("No RegisterNameIdentifierResponse elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierResponse
// object and process
for (int s = 0, n = rnirList.getLength(); s < n; ++s)
{
    RegisterNameIdentifierResponse rnir = new 
        RegisterNameIdentifierResponse((Element)rnirList.item(s));
    // Process RegisterNameIdentifierResponse element
    ...
}
この項では、Oracle Liberty SDKリリース1.1のサポート・クラスとインタフェースについて説明します。
サポート・クラスとインタフェースを次に示します。
oracle.security.xmlsec.liberty.v11.ac.AuthenticationContextURIインタフェース
oracle.security.xmlsec.util.ac.AuthenticationContextStatementクラス
oracle.security.xmlsec.liberty.v11.LibertyInitializerクラスは、Oracle Liberty SDKライブラリのロード時の初期化と構成を処理します。このクラスの静的なinitialize()メソッドをコールしてから、Oracle Liberty SDKのAPIをコールする必要があります。
oracle.security.xmlsec.liberty.v11.LibertyURIインタフェースは、アルゴリズム、ネームスペースおよびオブジェクトのURI文字列定数を定義します。次のネーミング規則が使用されます。
アルゴリズムのURIはalg_で始まります。
ネームスペースのURIはns_で始まります。
オブジェクト・タイプのURIはobj_で始まります。
LibertyプロファイルのネームスペースURIはprof_で始まります。
oracle.security.xmlsec.liberty.v11.ac.AuthenticationContextURIインタフェースは、アルゴリズム、ネームスペースおよびオブジェクトのURI文字列定数を定義します。次のネーミング規則が使用されます。
アルゴリズムのURIはalg_で始まります。
ネームスペースのURIはns_で始まります。
オブジェクト・タイプのURIはobj_で始まります。
oracle.security.xmlsec.util.ac.AuthenticationContextStatementクラスは、Liberty認証コンテキスト・スキーマの最上位レベルのAuthenticationContextStatement要素を表す抽象クラスです。このクラスの各具体実装は、Liberty認証コンテキスト仕様で定義された各クラスを表します。
oracle.security.xmlsec.saml.SAMLURIインタフェースは、アルゴリズム、ネームスペースおよびオブジェクトのURI文字列定数を定義します。次のネーミング規則が使用されます。
SAML 1.0仕様に定義されているアクションのネームスペースURIは、action_で始まります。
SAML 1.0仕様に定義されている認証メソッドのネームスペースURIは、authentication_method_で始まります。
SAML 1.0仕様に定義されている確認メソッドのネームスペースURIは、confirmation_method_で始まります。
ネームスペースのURIはns_で始まります。
Oracle Liberty SDKバージョン1.1のAPIリファレンスは次のドキュメントで参照できます。
Oracle Fusion Middleware Liberty 1.1 Java API Reference for Oracle Security Developer Tools
Oracleセキュリティ開発ツールを使用したサンプル・プログラムについては、Oracle Technology Network Webサイト(http://www.oracle.com/technology/sample_code/products/id_mgmt/index.html)を参照してください。
この項では、Oracle Liberty 1.2のクラスとインタフェースを示し、環境を設定してOracle Liberty 1.2を使用する方法について説明します。次の項目について説明します。
Oracleセキュリティ開発ツールは、Oracle Application ServerとともにORACLE_HOMEにインストールされます。
この項では、Oracle Liberty 1.2を使用するための環境設定について説明します。この項に含まれる内容は次のとおりです。
Oracle Liberty 1.2を使用するには、システムにJava Development Kit(JDK)バージョン1.5以上が必要です。また、PATH環境変数にJava binディレクトリが指定されていることを確認してください。
CLASSPATH環境変数には、必要なjarファイルおよびclassファイルすべてのフルパスとファイル名を指定してください。次の項目をCLASSPATHに指定します。
osdt_core.jar
osdt_cert.jar
osdt_xmlsec.jar
osdt_saml.jar
org.jaxen_1.1.1.jarファイル(Oracle XML Securityディストリビューションに含まれるJaxen XPathエンジン)
osdt_lib_v12.jar
CLASSPATHの設定WindowsでCLASSPATHを設定する手順を次に示します。
Windowsの「コントロール パネル」で「システム」を選択します。
「システムのプロパティ」ダイアログで「詳細設定」タブを選択します。
「環境変数」をクリックします。
ユーザー環境変数のセクションで「新規」をクリックし、CLASSPATH環境変数をユーザー・プロファイルに追加します。CLASSPATH環境変数がすでに存在している場合は、選択して「編集」をクリックします。
必要なjarファイルすべてのフルパスとファイル名をCLASSPATHに追加します。
たとえば、CLASSPATHは次のようになります。
%CLASSPATH%;%ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_core.jar; %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_cert.jar; %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_xmlsec.jar; %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_saml.jar; %ORACLE_HOME%\modules\org.jaxen_1.1.1.jar; %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_lib_v12.jar;
「OK」をクリックします。
CLASSPATHの設定UNIXでは、必要なjarファイルおよびclassファイルすべてのフルパスとファイル名を含むようにCLASSPATH環境変数を設定します。次に例を示します。
setenv CLASSPATH $CLASSPATH:$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_core.jar: $ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_cert.jar: $ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_xmlsec.jar: $ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_saml.jar: $ORACLE_HOME/modules/org.jaxen_1.1.1.jar: $ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_lib_v12.jar
この項では、Oracle Liberty SDKリリース1.2の有用なクラスとインタフェースの一部を示します。この項に含まれる内容は次のとおりです。
この項では、Oracle Liberty SDKリリース1.2のコア・クラスとインタフェースについて説明します。
コア・クラスを次に示します。
oracle.security.xmlsec.liberty.v12.FederationTerminationNotificationクラス
oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierRequestクラス
oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierResponseクラス
oracle.security.xmlsec.saml.Assertionクラスは、SAMLアサーション・スキーマのAssertion要素を表します。
例11-15に、新しいAssertion要素を作成して文書に追加する方法を示します。
例11-15 Assertion要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
Assertion assertion = new Assertion(doc);
doc.getDocumentElement().appendChild(assertion);
例11-16に、Assertion要素をXML文書から取得する方法を示します。
例11-16 文書からのAssertion要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all Assertion elements in the document
NodeList assrtList = 
    doc.getElementsByTagNameNS(SAMLURI.ns_saml, "Assertion");
if (assrtList.getLength() == 0)
    System.err.println("No Assertion elements found.");
 
// Convert each org.w3c.dom.Node object to 
// an oracle.security.xmlsec.saml.Assertion
// object and process
for (int s = 0, n = assrtList.getLength(); s < n; ++s)
{
    Assertion assertion = new Assertion((Element)assrtList.item(s));
    // Process Assertion element
    ...
}
oracle.security.xmlsec.samlp.Requestクラスは、SAMLプロトコル・スキーマのRequest要素を表します。
例11-17に、新しいRequest要素を作成して文書に追加する方法を示します。
例11-17 Request要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
Request request = new Request(doc);
doc.getDocumentElement().appendChild(request);
例11-18に、Request要素をXML文書から取得する方法を示します。
例11-18 文書からのRequest要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all Request elements in the document
NodeList reqList = 
    doc.getElementsByTagNameNS(SAMLURI.ns_samlp, "Request");
if (reqList.getLength() == 0)
    System.err.println("No Request elements found.");
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.samlp.Request
// object and process
for (int s = 0, n = reqList.getLength(); s < n; ++s)
{
    Request request = new Request((Element)reqList.item(s));
    // Process Request element
    ...
}
oracle.security.xmlsec.samlp.Responseクラスは、SAMLプロトコル・スキーマのResponse要素を表します。
例11-19に、新しい要素を作成して文書に追加する方法を示します。
例11-19 Response要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
Response response = new Response(doc);
doc.getDocumentElement().appendChild(response);
例11-20に、Response要素をXML文書から取得する方法を示します。
例11-20 文書からのResponse要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all Response elements in the document
NodeList respList = 
    doc.getElementsByTagNameNS(SAMLURI.ns_samlp, "Response");
if (respList.getLength() == 0)
    System.err.println("No Response elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.samlp.Response
// object and process
for (int s = 0, n = respList.getLength(); s < n; ++s)
{
    Response response = new Response((Element)respList.item(s));
    // Process Response element
    ...
}
oracle.security.xmlsec.liberty.v12.AuthnRequestクラスは、Libertyプロトコル・スキーマのAuthnRequest要素を表します。
例11-21に、新しい認可リクエスト要素を作成して文書に追加する方法を示します。
例11-21 AuthnRequest要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
AuthnRequest authnRequest = new AuthnRequest(doc);
doc.getDocumentElement().appendChild(authnRequest);
例11-22に、AuthnRequest要素をXML文書から取得する方法を示します。
例11-22 文書からのAuthnRequest要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all AuthnRequest elements in the document
NodeList arList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "AuthnRequest");
if (arList.getLength() == 0)
    System.err.println("No AuthnRequest elements found.");
 
// Convert each org.w3c.dom.Node object to
// an oracle.security.xmlsec.liberty.v12.AuthnRequest
// object and process
for (int s = 0, n = arList.getLength(); s < n; ++s)
{
    AuthnRequest authnRequest = new AuthnRequest((Element)arList.item(s));
    // Process AuthnRequest element
    ...
}
oracle.security.xmlsec.liberty.v12.AuthnResponseクラスは、Libertyプロトコル・スキーマのAuthnResponse要素を表します。
例11-23に、新しい認可レスポンス要素を作成して文書に追加する方法を示します。
例11-23 AuthnResponse要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
AuthnResponse authnResponse = new AuthnResponse(doc);
doc.getDocumentElement().appendChild(authnResponse);
例11-24に、AuthnResponse要素をXML文書から取得する方法を示します。
例11-24 文書からのAuthnResponse要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all AuthnResponse elements in the document.
NodeList arList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "AuthnResponse");
if (arList.getLength() == 0)
    System.err.println("No AuthnResponse elements found.");
 
// Convert each org.w3c.dom.Node object to 
// an oracle.security.xmlsec.liberty.v12.AuthnResponse
// object and process
for (int s = 0, n = arList.getLength(); s < n; ++s)
{
    AuthnResponse authnResponse = 
        new AuthnResponse((Element)arList.item(s));
    // Process AuthnResponse element
    ...
}
oracle.security.xmlsec.liberty.v12.FederationTerminationNotificationクラスは、Libertyプロトコル・スキーマのFederationTerminationNotification要素を表します。
例11-25に、新しいフェデレーション終了通知要素を作成して文書に追加する方法を示します。
例11-25 DocumentFederationTerminationNotification要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
FederationTerminationNotification ftn = 
    new FederationTerminationNotification(doc);
doc.getDocumentElement().appendChild(ftn);
例11-26に、フェデレーション終了通知要素をXML文書から取得する方法を示します。
例11-26 文書からのFederationTerminationNotification要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all FederationTerminationNotification elements in the document
NodeList ftnList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty,
    "FederationTerminationNotification");
if (ftnList.getLength() == 0)
    System.err.println("No FederationTerminationNotification elements found.");
 
// Convert each org.w3c.dom.Node object to an
// oracle.security.xmlsec.liberty.v12.FederationTerminationNotification
// object and process
for (int s = 0, n = ftnList.getLength(); s < n; ++s)
{
    FederationTerminationNotification ftn = new 
        FederationTerminationNotification((Element)ftnList.item(s));
    // Process FederationTerminationNotification element
    ...
}
oracle.security.xmlsec.liberty.v12.LogoutRequestクラスは、Libertyプロトコル・スキーマのLogoutRequest要素を表します。
例11-27に、新しい要素を作成して文書に追加する方法を示します。
例11-27 新しいLogoutRequest要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
LogoutRequest lr = new LogoutRequest(doc);
doc.getDocumentElement().appendChild(lr);
例12-28に、ログアウト・リクエスト要素をXML文書から取得する方法を示します。
例11-28 XML文書からのLogoutRequest要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all LogoutRequest elements in the document
NodeList lrList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "LogoutRequest");
if (lrList.getLength() == 0)
    System.err.println("No LogoutRequest elements found.");
 
// Convert each org.w3c.dom.Node object to
// an oracle.security.xmlsec.liberty.v12.LogoutRequest
// object and process
for (int s = 0, n = lrList.getLength(); s < n; ++s)
{
    LogoutRequest lr = new LogoutRequest((Element)lrList.item(s));
    // Process LogoutRequest element
    ...
}
oracle.security.xmlsec.liberty.v12.LogoutResponseクラスは、Libertyプロトコル・スキーマのLogoutResponse要素を表します。
例11-29に、新しいログアウト・レスポンス要素を作成して文書に追加する方法を示します。
例11-29 新しいLogoutResponse要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
LogoutResponse lr = new LogoutResponse(doc);
doc.getDocumentElement().appendChild(lr);
 
例11-30に、ログアウト・レスポンス要素をXML文書から取得する方法を示します。
例11-30 XML文書からのLogoutResponse要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all LogoutResponse elements in the document
NodeList lrList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "LogoutResponse");
if (lrList.getLength() == 0)
    System.err.println("No LogoutResponse elements found.");
 
// Convert each org.w3c.dom.Node object to
// an oracle.security.xmlsec.liberty.v12.LogoutResponse
// object and process
for (int s = 0, n = lrList.getLength(); s < n; ++s)
{
    LogoutResponse lr = new LogoutResponse((Element)lrList.item(s));
    // Process LogoutResponse element
    ...
}
oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierRequestクラスは、Libertyプロトコル・スキーマのRegisterNameIdentifierRequest要素を表します。
例11-31に、新しいRegisterNameIdentifierRequest要素を作成して文書に追加する方法を示します。
例11-31 新しいRegisterNameIdentifierRequest要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierRequest rnir = new RegisterNameIdentifierRequest(doc);
doc.getDocumentElement().appendChild(rnir);
例11-32に、RegisterNameIdentifierRequest要素をXML文書から取得する方法を示します。
例11-32 XML文書からのRegisterNameIdentifierRequest要素の取得
Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all 
// RegisterNameIdentifierRequest elements 
// in the document
NodeList rnirList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty,
    "RegisterNameIdentifierRequest");
if (rnirList.getLength() == 0)
    System.err.println("No RegisterNameIdentifierRequest elements found.");
 
// Convert each org.w3c.dom.Node object to a 
// oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierRequest
// object and process
for (int s = 0, n = rnirList.getLength(); s < n; ++s)
{
    RegisterNameIdentifierRequest rnir =
         new RegisterNameIdentifierRequest((Element)rnirList.item(s));
    // Process RegisterNameIdentifierRequest element
    ...
}
oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierResponseクラスは、Libertyプロトコル・スキーマのRegisterNameIdentifierResponse要素を表します。
例11-33に、新しいRegisterNameIdentifierResponse要素を作成して文書に追加する方法を示します。
例11-33 新しいRegisterNameIdentifierResponse要素の作成と文書への追加
Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierResponse rnir = 
    new RegisterNameIdentifierResponse(doc);
doc.getDocumentElement().appendChild(rnir);
例11-34に、RegisterNameIdentifierResponse要素をXML文書から取得する方法を示します。
例11-34 文書からのRegisterNameIdentifierResponse要素の取得
Document doc = Instance of org.w3c.dom.Document;
// Get list of all RegisterNameIdentifierResponse elements in the document
NodeList rnirList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, 
        "RegisterNameIdentifierResponse");
if (rnirList.getLength() == 0)
    System.err.println("No RegisterNameIdentifierResponse elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierResponse
// object and process
for (int s = 0, n = rnirList.getLength(); s < n; ++s)
{
    RegisterNameIdentifierResponse rnir = new 
        RegisterNameIdentifierResponse((Element)rnirList.item(s));
    // Process RegisterNameIdentifierResponse element
    ...
}
この項では、Oracle Liberty SDKリリース1.2のサポート・クラスとインタフェースについて説明します。
oracle.security.xmlsec.liberty.v12.LibertyInitializerクラス
oracle.security.xmlsec.liberty.v12.LibertyURIインタフェース
oracle.security.xmlsec.util.ac.AuthenticationContextStatementクラス
oracle.security.xmlsec.saml.SAMLInitializerクラス
oracle.security.xmlsec.saml.SAMLURIインタフェース
このクラスは、Oracle Liberty SDK 1.2ライブラリのロード時の初期化と構成を処理します。このクラスの静的なinitialize()メソッドをコールしてから、Oracle Liberty SDK 1.2のAPIをコールする必要があります。
このインタフェースは、アルゴリズム、ネームスペースおよびオブジェクトのURI文字列定数を定義します。
これは、Liberty認証コンテキスト・スキーマの最上位レベルのAuthenticationContextStatement要素を表す抽象クラスです。このクラスの各具体実装は、Liberty認証コンテキスト仕様で定義された各クラスを表します。
このクラスは、Oracle SAMLライブラリのロード時の初期化と構成を処理します。リリース1.1では、このクラスの静的なinitialize(int major, int minor)メソッドをコールしてから、Oracle SAML Toolkit API for SAML 1.1をコールする必要があります。
oracle.security.xmlsec.saml.SAMLURIインタフェースは、アルゴリズム、ネームスペースおよびオブジェクトのURI文字列定数を定義します。次のネーミング規則が使用されます。
SAML 1.1仕様に定義されているアクションのネームスペースURIは、action_で始まります。
SAML 1.1仕様に定義されている認証メソッドのネームスペースURIは、authentication_method_で始まります。
SAML 1.1仕様に定義されている確認メソッドのネームスペースURIは、confirmation_method_で始まります。
ネームスペースのURIはns_で始まります。
Oracle Liberty SDKバージョン1.2のAPIリファレンス(Javadoc)は次のドキュメントで参照できます。
Oracle Fusion Middleware Liberty 1.2 Java API Reference for Oracle Security Developer Tools
Oracleセキュリティ開発ツールを使用したサンプル・プログラムについては、Oracle Technology Network Webサイト(http://www.oracle.com/technology/sample_code/products/id_mgmt/index.html)を参照してください。