4.5 Sample Codes

4.5.1 Data Extension for External Attribute Source Policy

This example demonstrates how an External Attribute Source policy retrieves information from external sources. It provides details about:

  • How to configure and install the External Attribute Source Data policy extension in Administration Console.

  • Implementation details of the extension factory and extension classes.

  • How to use the information retrieved from the External Attribute Source policies as shared secret. It also explains how to use that shared secret to configure other policies or use them in Identity Servers to retrieve attributes from external sources.

The policy extension example includes NameAttributeFromMailIDFactory.java and NameAttributeFromMailID.java.

4.5.2 Template Policy Extensions

This includes the following two types:

  • Template Condition Policy

  • Template Data Policy

  • Template Action Policy

Template Condition Policy

You can use this example as a template to implement a policy extension of type Condition that is com.novell.nxpe.NxpeCondition. This example provides a basic framework that can be used as a starting point for creating data policy (com.novell.nxpe.NxpeContextDataElement.) extensions. It provides details about:

  • How to configure and install a Condition policy extension in Administration Console.

  • Implementation details of the extension factory and extension classes.

The policy extension example includes PolicyConditionExtnFactoryTemplate.java and PolicyConditionExtnTemplate.java.

Template Data Policy

You can use this example as a template to implement a policy extension of type Data that is com.novell.nxpe.NxpeContextDataElement. This example provides a basic framework that can be used as a starting point for creating such policy extensions. It provides details about:

  • How to configure and install the Data policy extension in Administration Console.

  • Implementation details of the extension factory and extension classes.

The policy extension example includes PolicyDataExtnFactoryTemplate.java and PolicyDataExtnTemplate.java.

Template Action Policy

You can use this example as a template to implement a policy extension of type Action that is com.novell.nxpe.NxpeContextActionElement. The action policy extension are of the following types: Permit, Deny, and Obligation. This example provides a basic framework that can be used as a starting point for creating such policy extensions. It provides details about:

  • How to configure and install the Action policy extension - Permit, Deny, and Obligation, in Administration Console.

  • Implementation details of the extension factory and extension classes.

The policy extension example includes:

  • PolicyActionExtnDenyFactoryTemplate.java

  • PolicyActionExtnDenyTemplate.java

  • PolicyActionExtnPermitFactoryTemplate.java

  • PolicyActionExtnPermitTemplate.java

4.5.3 LDAP Group Data Element

This example illustrates how a policy extension can use external data sources to obtain information. This policy extension connects to the required LDAP repository, runs a search on it, and returns the results. An Identity Injection policy is created in this example that uses this policy extension.

The policy extension example includes LDAPGroupDataElement.java and LDAPGroupDataElementFactory.java.

4.5.4 PasswordClass

This authentication class extends the base class LocalAuthenticationClass and performs a form based authentication. The policy extension example includes passwordClass.java.

For more information, see Section 2.4, Authentication Class Example and Section 2.6, Deploying Your Authentication Class.