10 Oracle Liberty SDK

Oracle Liberty SDK allows Java developers to design and develop single sign-on (SSO) and federated identity management (FIM) solutions. It aims to unify, simplify, and extend all aspects of development and integration of systems conforming to the Liberty Alliance ID-FF 1.1 and 1.2 specifications.

The Liberty Alliance was founded with the goal of allowing individuals and businesses to engage in virtually any transaction without compromising the privacy and security of vital identity information. Specifications issued by the Liberty Alliance are based on an open identity federation framework, allowing partner companies to form business relationships based on a cross-organizational, federated network identity model.

This chapter contains these topics:

10.1 Oracle Liberty SDK Features and Benefits

Oracle Liberty SDK 1.1 and 1.2 enable simplified software development through the use of an intuitive and straightforward Java API. The toolkits provide tools, information, and examples to help you develop solutions that conform to the Liberty Alliance specifications. The toolkits can also be seamlessly integrated into any existing Java solution, including applets, applications, EJBs, servlets, JSPs, and so on.

The Oracle Liberty SDK is a pure java solution which provides the following features:

  • Support for the Liberty Alliance ID-FF version 1.1 and 1.2 specifications

  • Support for Liberty-based Single Sign-on and Federated Identity protocols

  • Support for the SAML 1.0/1.1 specifications

See Also:

You can find the Liberty Alliance specifications at http://www.projectliberty.org/resources/specifications.php.

10.2 Oracle Liberty 1.1

Oracle Liberty 1.1 conforms to the Liberty Alliance ID-FF 1.1 specifications. It contains classes, interfaces, and methods to provide functionality such as authentication request/response, logout request/response, and federation termination.

This section explains how to set up your environment for and use Oracle Liberty 1.1, and describes the classes and interfaces of Oracle Liberty 1.1. It contains the following topics:

10.2.1 Setting Up Your Oracle Liberty 1.1 Environment

You can setup Oracle Liberty 1.1 environment by installing Oracle Security Developer Tools and Java Development Kit (JDK), and setting the CLASSPATH variable to all of the required jar and class files.

The Oracle Security Developer Tools are installed with Oracle WebLogic Server in ORACLE_HOME.

10.2.1.1 Understanding System Requirements for Oracle Liberty 1.1

In order to use Oracle Liberty 1.1, your system must have the Java Development Kit (JDK) version 1.6 or higher.

Your CLASSPATH environment variable must contain the full path and file names to all of the required jar and class files. Make sure the following items are included in your CLASSPATH:

  • osdt_core.jar

  • osdt_cert.jar

  • osdt_xmlsec.jar

  • osdt_saml.jar

  • The org.jaxen_1.1.1.jar file (Jaxen XPath engine, included with your Oracle XML Security distribution)

  • the osdt_lib_v11.jar file

For example, your CLASSPATH might look like this:

%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;

10.2.2 Overview of Oracle Liberty 1.1 Classes and Interfaces

Oracle Liberty SDK v. 1.1 contains core and supporting classes and interfaces to provide functionality such as authentication request/response, logout request/response, and federation termination

This section introduces some useful classes and interfaces of Oracle Liberty SDK v. 1.1. It contains these topics:

10.2.2.1 Using Core Classes and Interfaces
10.2.2.1.1 Using the oracle.security.xmlsec.liberty.v11.AuthnRequest Class

This class represents the AuthnRequest element of the Liberty protocol schema.

This example shows how to create a new AuthnRequest element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
AuthnRequest authnRequest = new AuthnRequest(doc);
doc.getDocumentElement().appendChild(authnRequest);

This example shows how to obtain AuthnRequest elements from an XML document.

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
    ...
}
10.2.2.1.2 Using the oracle.security.xmlsec.liberty.v11.AuthnResponse Class

This class represents the AuthnResponse element of the Liberty protocol schema.

This example shows how to create a new AuthnResponse element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
AuthnResponse authnResponse = new AuthnResponse(doc);
doc.getDocumentElement().appendChild(authnResponse);

This example shows how to obtain AuthnResponse elements from an XML document.

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
    ...
}
10.2.2.1.3 Using the oracle.security.xmlsec.liberty.v11.FederationTerminationNotification Class

This class represents the FederationTerminationNotification element of the Liberty protocol schema.

This example shows how to create a new federation termination notification element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
FederationTerminationNotification ftn = 
    new FederationTerminationNotification(doc);
doc.getDocumentElement().appendChild(ftn);

This example shows how to obtain federation termination notification elements from an XML document.

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
    ...
}
10.2.2.1.4 Using the oracle.security.xmlsec.liberty.v11.LogoutRequest Class

This class represents the LogoutRequest element of the Liberty protocol schema.

This example shows how to create a new LogoutRequest element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
LogoutRequest lr = new LogoutRequest(doc);
doc.getDocumentElement().appendChild(lr);

This example shows how to obtain LogoutRequest elements from an XML document.

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
    ...
}
10.2.2.1.5 Using the oracle.security.xmlsec.liberty.v11.LogoutResponse Class

This class represents the LogoutResponse element of the Liberty protocol schema.

This example shows how to create a new LogoutResponse element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
LogoutResponse lr = new LogoutResponse(doc);
doc.getDocumentElement().appendChild(lr);

This example shows how to obtain LogoutResponse elements from an XML document.

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
    ...
}
10.2.2.1.6 Using the oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierRequest Class

This class represents the RegisterNameIdentifierRequest element of the Liberty protocol schema.

This example shows how to create a new RegisterNameIdentifierRequest element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierRequest rnir = 
    new RegisterNameIdentifierRequest(doc);
doc.getDocumentElement().appendChild(rnir);

This example shows how to obtain RegisterNameIdentifierRequest elements from an XML document.

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
    ...
}
10.2.2.1.7 Using the oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierResponse Class

This class represents the RegisterNameIdentifierResponse element of the Liberty protocol schema.

This example shows how to create a new RegisterNameIdentifierResponse element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierResponse rnir = new RegisterNameIdentifierResponse(doc);
doc.getDocumentElement().appendChild(rnir);

This example shows how to obtain RegisterNameIdentifierResponse elements from an XML document.

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
    ...
}
10.2.2.2 Using Supporting Classes and Interfaces
10.2.2.2.1 Using the oracle.security.xmlsec.liberty.v11.LibertyInitializer class

The oracle.security.xmlsec.liberty.v11.LibertyInitializer class handles load-time initialization and configuration of the Oracle Liberty SDK library. You must call this class's static initialize() method before making any calls to the Oracle Liberty SDK API.

10.2.2.2.2 The oracle.security.xmlsec.liberty.v11.LibertyURI interface

The oracle.security.xmlsec.liberty.v11.LibertyURI interface defines URI string constants for algorithms, namespaces and objects. The following naming convention is used:

  • Algorithm URIs begin with "alg_".

  • Namespace URIs begin with "ns_".

  • Object type URIs begin with "obj_".

  • Liberty profile namespace URIs begin with "prof_".

10.2.2.2.3 Using the oracle.security.xmlsec.liberty.v11.ac.AuthenticationContextURI interface

The oracle.security.xmlsec.liberty.v11.ac.AuthenticationContextURI interface defines URI string constants for algorithms, namespaces and objects. The following naming convention is used:

  • Algorithm URIs begin with "alg_".

  • Namespace URIs begin with "ns_".

  • Object type URIs begin with "obj_".

10.2.2.2.4 The oracle.security.xmlsec.util.ac.AuthenticationContextStatement class

The oracle.security.xmlsec.util.ac.AuthenticationContextStatement class is an abstract class representing the top-level AuthenticationContextStatement element of the Liberty authentication context schema. Each concrete implementation of this class represents a respective class defined in the Liberty Authentication Context Specification.

10.2.2.2.5 The oracle.security.xmlsec.saml.SAMLURI Interface

The oracle.security.xmlsec.saml.SAMLURI interface defines URI string constants for algorithms, namespaces and objects. The following naming convention is used:

  • Action namespace URIs defined in the SAML 1.0 specifications begin with "action_"

  • Authentication method namespace URIs defined in the SAML 1.0 specifications begin with "authentication_method_".

  • Confirmation method namespace URIs defined in the SAML 1.0 specifications begin with "confirmation_method_".

  • Namespace URIs begin with "ns_".

10.2.2.2.6 The oracle.security.xmlsec.saml.SAMLMessage class

The oracle.security.xmlsec.saml.SAMLMessage class is the base class for all the SAML and SAML extension messages that may be signed and contain an XML-DSIG structure.

10.2.3 The Oracle Liberty 1.1 API Reference

The Oracle Fusion Middleware Java API Reference for Oracle Security Developer Tools guide explains classes, interfaces, and the methods available in Oracle Liberty SDK v1.1.

10.3 Oracle Liberty 1.2

Oracle Liberty 1.2 conforms to the Liberty Alliance ID-FF 1.2 specifications. You can setup your environment and use the classes and interfaces in Oracle Liberty 1.2 to provide functionality as per the specifications.

This section describes the classes and interfaces of Oracle Liberty 1.2, and explains how to set up your environment and use Oracle Liberty 1.2.

It contains these sections:

10.3.1 Setting Up Your Oracle Liberty 1.2 Environment

You can setup Oracle Liberty 1.2 environment by installing Oracle Security Developer Tools and Java Development Kit (JDK), and setting the CLASSPATH variable to all of the required jar and class files.

The Oracle Security Developer Tools are installed with Oracle WebLogic Server in ORACLE_HOME.

In order to use Oracle Liberty 1.2, your system must have the Java Development Kit (JDK) version 1.6 or higher. Also, make sure that your PATH environment variable includes the Java bin directory.

Your CLASSPATH environment variable must contain the full path and file names to all of the required jar and class files. Make sure the following items are included in your CLASSPATH:

  • osdt_core.jar

  • osdt_cert.jar

  • osdt_xmlsec.jar

  • osdt_saml.jar

  • The org.jaxen_1.1.1.jar file (Jaxen XPath engine, included with your Oracle XML Security distribution)

  • osdt_lib_v12.jar

For example your classpath may look like this:

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

10.3.2 Overview of Oracle Liberty 1.2 Classes and Interfaces

Oracle Liberty 1.2 contains multiple core and supporting classes and interfaces. Useful classes of Liberty 1.2 include assertion, request, response, authentication request/response, and others.

This section introduces classes and interfaces of Oracle Liberty SDK v. 1.2. It contains these topics:

10.3.2.1 Core Classes and Interfaces
10.3.2.1.1 Using the oracle.security.xmlsec.saml.Assertion class

The oracle.security.xmlsec.saml.Assertion class represents the Assertion element of the SAML Assertion schema.

This example shows how to create a new assertion element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
Assertion assertion = new Assertion(doc);
doc.getDocumentElement().appendChild(assertion);

This example shows how to obtain assertion elements from an XML document.

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
    ...
}
10.3.2.1.2 Using the oracle.security.xmlsec.samlp.Request class

The oracle.security.xmlsec.samlp.Request class represents the Request element of the SAML Protocol schema.

This example shows how to create a new Request element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
Request request = new Request(doc);
doc.getDocumentElement().appendChild(request);

This example shows how to obtain Request elements from an XML document.

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
    ...
}
10.3.2.1.3 Using the oracle.security.xmlsec.samlp.Response class

The oracle.security.xmlsec.samlp.Response class represents the Response element of the SAML Protocol schema.

This example shows how to create a new element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
Response response = new Response(doc);
doc.getDocumentElement().appendChild(response);

This example shows how to obtain Response elements from an XML document.

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
    ...
}
10.3.2.1.4 Using the oracle.security.xmlsec.liberty.v12.AuthnRequest class

The oracle.security.xmlsec.liberty.v12.AuthnRequest class represents the AuthnRequest element of the Liberty protocol schema.

This example shows how to create a new authorization request element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
AuthnRequest authnRequest = new AuthnRequest(doc);
doc.getDocumentElement().appendChild(authnRequest);

This example shows how to obtain AuthnRequest elements from an XML document.

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
    ...
}
10.3.2.1.5 Using the oracle.security.xmlsec.liberty.v12.AuthnResponse class

The oracle.security.xmlsec.liberty.v12.AuthnResponse class represents the AuthnResponse element of the Liberty protocol schema.

This example shows how to create a new authorization response element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
AuthnResponse authnResponse = new AuthnResponse(doc);
doc.getDocumentElement().appendChild(authnResponse);

This example shows how to obtain AuthnResponse elements from an XML document.

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
    ...
}
10.3.2.1.6 Using the oracle.security.xmlsec.liberty.v12.FederationTerminationNotification class

The oracle.security.xmlsec.liberty.v12.FederationTerminationNotification class represents the FederationTerminationNotification element of the Liberty protocol schema.

This example shows how to create a new federation termination notification element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
FederationTerminationNotification ftn = 
    new FederationTerminationNotification(doc);
doc.getDocumentElement().appendChild(ftn);

This example shows how to obtain federation termination notification elements from an XML document.

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
    ...
}
10.3.2.1.7 Using the oracle.security.xmlsec.liberty.v12.LogoutRequest class

The oracle.security.xmlsec.liberty.v12.LogoutRequest class represents the LogoutRequest element of the Liberty protocol schema.

This example shows how to create a new element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
LogoutRequest lr = new LogoutRequest(doc);
doc.getDocumentElement().appendChild(lr);

This example shows how to obtain logout request elements from an XML document.

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
    ...
}
10.3.2.1.8 Using the oracle.security.xmlsec.liberty.v12.LogoutResponse class

The oracle.security.xmlsec.liberty.v12.LogoutResponse class represents the LogoutResponse element of the Liberty protocol schema.

This example shows how to create a new logout response element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
LogoutResponse lr = new LogoutResponse(doc);
doc.getDocumentElement().appendChild(lr);
 

This example shows how to obtain logout response elements from an XML document.

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
    ...
}
10.3.2.1.9 Using the oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierRequest class

The oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierRequest class represents the RegisterNameIdentifierRequest element of the Liberty protocol schema.

This example shows how to create a new RegisterNameIdentifierRequest element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierRequest rnir = new RegisterNameIdentifierRequest(doc);
doc.getDocumentElement().appendChild(rnir);

This example shows how to obtain RegisterNameIdentifierRequest elements from an XML document.

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
    ...
}
10.3.2.1.10 Using the oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierResponse class

The oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierResponse class represents the RegisterNameIdentifierResponse element of the Liberty protocol schema.

This example shows how to create a new RegisterNameIdentifierResponse element and append it to a document.

Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierResponse rnir = 
    new RegisterNameIdentifierResponse(doc);
doc.getDocumentElement().appendChild(rnir);

This example shows how to obtain RegisterNameIdentifierResponse elements from an XML document.

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
    ...
}
10.3.2.2 Supporting Classes and Interfaces

This section describes supporting classes and interfaces of Oracle Liberty SDK v. 1.2:

  • The oracle.security.xmlsec.liberty.v12.LibertyInitializer class

  • The oracle.security.xmlsec.liberty.v12.LibertyURI interface

  • The oracle.security.xmlsec.util.ac.AuthenticationContextStatement class

  • The oracle.security.xmlsec.saml.SAMLInitializer class

  • The oracle.security.xmlsec.saml.SAMLURI interface

10.3.2.2.1 The oracle.security.xmlsec.liberty.v12.LibertyInitializer class

This class handles load-time initialization and configuration of the Oracle Liberty SDK 1.2 library. You must call this class's static initialize() method before making any calls to the Oracle Liberty SDK 1.2 API.

10.3.2.2.2 The oracle.security.xmlsec.liberty.v12.LibertyURI interface

This interface defines URI string constants for algorithms, namespaces, and objects.

10.3.2.2.3 The oracle.security.xmlsec.util.ac.AuthenticationContextStatement class

This is an abstract class representing the top-level AuthenticationContextStatement element of the Liberty authentication context schema. Each concrete implementation of this class represents the respective class defined in the Liberty Authentication Context Specification.

10.3.2.2.4 The oracle.security.xmlsec.saml.SAMLInitializer class

This class handles load-time initialization and configuration of the Oracle SAML library. You should call this class's static initialize(int major, int minor) method, for version 1.1, before making any calls to the Oracle SAML Toolkit API for SAML 1.1.

10.3.2.2.5 The oracle.security.xmlsec.saml.SAMLURI Interface

The oracle.security.xmlsec.saml.SAMLURI interface defines URI string constants for algorithms, namespaces, and objects. The following naming convention is used:

  • Action Namespace URIs defined in the SAML 1.1 specifications begin with "action_"

  • Authentication Method Namespace URIs defined in the SAML 1.1 specifications begin with "authentication_method_"

  • Confirmation Method Namespace URIs defined in the SAML 1.1 specifications begin with "confirmation_method_"

  • Namespace URIs begin with "ns_"

10.3.2.2.6 The oracle.security.xmlsec.saml.SAMLMessage Class

oracle.security.xmlsec.saml.SAMLMessage is the base class for all the SAML and SAML extension messages that may be signed and contain an XML-DSIG structure.

10.3.3 The Oracle Liberty SDK 1.2 API Reference

The Oracle Fusion Middleware Java API Reference for Oracle Security Developer Tools guide explains the classes, interfaces, and methods available in Oracle Liberty SDK v1.2 API.