Thursday, June 18, 2015

OIM 11G Separate User ID and Email Notification use case and detailed steps to achieve it



In this post, I will talk about sending separate userid and password email on user onborading.

Existing Process

Modify the existing "Generated Password Notification" and remove $username

Add new CREATE USER post-process Event Handler and send only username.

Create a new Notification Event Resolver

Create a new Notification Template

Event Metadata  ->  Notification Resolver -> Notification Template
-----------------------------------------------------------------------------------------------------------------------------------------------

OIM 11g: How to Disable Email Notification? [ID 1473778.1]

1) Export from MDS the file /metadata/iam-features-selfservice/event-definition/EventHandlers.xml. Instructions to import export can be found here. Save a local copy for future reference.

2) Remove the section

<postprocess-handler
class="oracle.iam.selfservice.uself.uselfmgmt.impl.handlers.create.SelfServiceNotificationHandler"
entity-type="User"
operation="CREATE"
name="SelfServiceNotificationHandler"
order="1160"
stage="postprocess"
sync="TRUE">
</postprocess-handler>

3) Export from MDS the file 
/metadata/iam-features-passwordmgmt/event-definition/EventHandlers.xml .


4) Remove the section:

<postprocess-handler
class="oracle.iam.passwordmgmt.eventhandlers.PasswordNotificationHandler"
entity-type="User" operation="CREATE" name="PasswordNotificationHandler"
order="1180" stage="postprocess" sync="TRUE">
</postprocess-handler>

5) Import these two files back into MDS.

6) Reexport the above two files again to verify your edits got uploaded to MDS correctly.

7) Set the system property in OIM "Should send notifications in recon or not" to FALSE.

Notes:

  (1) Currently notifications are sent in the following scenarios by event handlers in case users are created through UI or through SPML (since internally we are having a single code path -- create user orchestration) .

    Create user with manual password – SelfServiceNotificationHandler

        This can be disabled to suppress the notification being sent.

        MDS Location :
/metadata/iam-features-selfservice/event-definition/EventHandlers.xml, Edit out the section for SelfServiceNotificationHandler

Admin create user with auto-gen password – PasswordNotificationHandler

This can be disabled to suppress the notification being sent.
        MDS Location : 
/metadata/iam-features-passwordmgmt/event-definition/EventHandlers.xm, 
edit out the section for PasswordNotificationHandler
    Admin change password with manual password – Via UI based on the email checkbox selected on the UI.
        UI checkbox can be selected appropriately .
    Admin change password with auto-gen password (reset password) – ResetPasswordActionHandler
        This is NOT a post-processing handler that can be disabled. Not configurable, as password needs to be communicated

(2) LDAP Sync Scenario:

System Property name which is specific to Recon to disable notification, Recon.SEND_NOTIFICATION. This property is exercised when the users are getting created through LDAP sync.
  (3) Notes on how to edit out the event handlers :

http://download.oracle.com/docs/cd/E14571_01/doc.1111/e14309/utils.htm

-----------------------------------------------------------------------------------------------------------------------------------------------

<?xml version='1.0' encoding='UTF-8'?>
<eventhandlers xmlns="http://www.oracle.com/schema/oim/platform/kernel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">

<!--REMOVE---->
<postprocess-handler class="oracle.iam.selfservice.uself.uselfmgmt.impl.handlers.create.SelfServicePostHandler" entity-type="User" operation="CREATE" name="SelfServicePostHandler" order="1000000" stage="postprocess" sync="TRUE"/>


<preview-handler class="oracle.iam.selfservice.self.selfmgmt.impl.handlers.setchallenge.SetChallengeValuesPreviewHandler" entity-type="User" operation="SELFSETCHALLENGE" name="SetChallengeValuesPreviewHandler" order="FIRST"/>
<validation-handler class="oracle.iam.selfservice.self.selfmgmt.impl.handlers.setchallenge.SetChallengeValuesValidationHandler" entity-type="User" operation="SELFSETCHALLENGE" name="SetChallengeValuesValidationHandler" order="FIRST"/>
<action-handler class="oracle.iam.selfservice.self.selfmgmt.impl.handlers.setchallenge.SetChallengeValuesActionHandler" entity-type="User" operation="SELFSETCHALLENGE" name="SetChallengeValuesActionHandler" order="FIRST" stage="action" sync="TRUE"/>
<preview-handler class="oracle.iam.selfservice.self.selfmgmt.impl.handlers.expiredpwd.ExpiredPasswordPreviewHandler" entity-type="User" operation="SELFEXPIREDPWD" name="ExpiredPasswordPreviewHandler" order="FIRST"/>
<action-handler class="oracle.iam.selfservice.self.selfmgmt.impl.handlers.expiredpwd.ExpiredPasswordActionHandler" entity-type="User" operation="SELFEXPIREDPWD" name="ExpiredPasswordActionHandler" order="FIRST" stage="action" sync="TRUE"/>
<preview-handler class="oracle.iam.selfservice.self.selfmgmt.impl.handlers.changepwd.ChangePasswordPreviewHandler" entity-type="User" operation="CHANGE_PASSWORD" name="SelfChangePasswordPreviewHandler" order="FIRST"/>
<validation-handler class="oracle.iam.selfservice.self.selfmgmt.impl.handlers.changepwd.ChangePasswordValidationHandler" entity-type="User" operation="CHANGE_PASSWORD" name="SelfChangePasswordValidationHandler" order="FIRST"/>
<action-handler class="oracle.iam.selfservice.self.selfmgmt.impl.handlers.changepwd.ChangePasswordActionHandler" entity-type="User" operation="CHANGE_PASSWORD" name="SelfChangePasswordActionHandler" order="FIRST" stage="action" sync="TRUE"/>
<postprocess-handler class="oracle.iam.selfservice.uself.uselfmgmt.impl.handlers.create.SelfServiceNotificationHandler" entity-type="User" operation="CREATE" name="SelfServiceNotificationHandler" order="1160" stage="postprocess" sync="TRUE"/>
</eventhandlers>
-----------------------------------------------------------------------------------------------------------------------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<eventhandlers xmlns="http://www.oracle.com/schema/oim/platform/kernel" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/schema/oim/platform/kernel orchestration-handlers.xsd">
<preview-handler class="oracle.iam.passwordmgmt.eventhandlers.ResetPasswordPreviewHandler" entity-type="User" operation="RESET_PASSWORD" name="ResetPasswordPreviewHandler" order="FIRST"/>
<validation-handler class="oracle.iam.passwordmgmt.eventhandlers.ResetPasswordValidationHandler" entity-type="User" operation="RESET_PASSWORD" name="ResetPasswordValidationHandler" order="FIRST" sync="TRUE"/>
<validation-handler class="oracle.iam.passwordmgmt.eventhandlers.UserPasswordValidationHandler" entity-type="User" operation="CREATE" name="UserPasswordValidationHandler" order="1020"/>
<validation-handler class="oracle.iam.passwordmgmt.eventhandlers.UserPasswordValidationHandler" entity-type="User" operation="CHANGE_PASSWORD" name="UserPasswordValidationHandler" order="2"/>
<action-handler class="oracle.iam.passwordmgmt.eventhandlers.ResetPasswordPreProcessHandler" entity-type="User" operation="RESET_PASSWORD" name="ResetPasswordPreProcessHandler" stage="preprocess" sync="TRUE" order="9900"/>
<action-handler class="oracle.iam.passwordmgmt.eventhandlers.ResetPasswordActionHandler" entity-type="User" operation="RESET_PASSWORD" name="ResetPasswordActionHandler" order="FIRST" stage="action" sync="TRUE"/>

<!--REMOVE--->
<postprocess-handler class="oracle.iam.passwordmgmt.eventhandlers.PasswordNotificationHandler" entity-type="User" operation="CREATE" name="PasswordNotificationHandler" order="1180" stage="postprocess" sync="TRUE"/>



<postprocess-handler class="oracle.iam.passwordmgmt.eventhandlers.PasswordHistoryPostProcessHandler" entity-type="User" operation="CREATE" name="PasswordHistoryPostProcessHandler" order="1200" stage="postprocess" sync="TRUE"/>
<postprocess-handler class="oracle.iam.passwordmgmt.eventhandlers.PasswordHistoryPostProcessHandler" entity-type="User" operation="CHANGE_PASSWORD" name="PasswordHistoryPostProcessHandler" order="SECOND" stage="postprocess" sync="TRUE"/>
</eventhandlers>

-----------------------------------------------------------------------------------------------------------------------------------------------
Notification RESOLVER
-----------------------------------------------------------------------------------------------------------------------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<Events xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../notification/metadata/NotificationEvent.xsd">
<EventType name="CreateSelfUser">
<Resolver class="oracle.iam.selfservice.notification.CreateNewSelfUserResolver">
<Param Name="CreateSelfUser" DataType="X2-Entity" EntityName="CreateSelfUser"/>
</Resolver>
</EventType>
</Events>
__________________________________________________________________________________________________________________________________________________
NotificationEvent.xsd
---------------------------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

          <xs:complexType name="ParamType">
               <xs:attribute name="Name" type="xs:string" use="required" />
               <xs:attribute name="DataType" use="required">
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:enumeration value="X2-Entity" />
                              <xs:enumeration value="91-Entity" />
                         </xs:restriction>
                    </xs:simpleType>
               </xs:attribute>
               <xs:attribute name="EntityName" type="xs:string"></xs:attribute>
          </xs:complexType>


          <xs:complexType name="AttributeType">
               <xs:attribute name="Name" type="xs:string" use="required" />
               <xs:attribute name="DataType" use="required" >
                    <xs:simpleType>
                         <xs:restriction base="xs:string">
                              <xs:enumeration value="X2-Entity" />
                              <xs:enumeration value="91-Entity" />
                              <xs:enumeration value="X2-DataSet" />
                         </xs:restriction>
                    </xs:simpleType>             
               </xs:attribute>
               <xs:attribute name="EntityName" type="xs:string"></xs:attribute>
          </xs:complexType>

          <xs:complexType name="StaticDataType">
               <xs:sequence>
                    <xs:element name="Attribute" minOccurs="0" maxOccurs="unbounded"
                         type="AttributeType" />
               </xs:sequence>
          </xs:complexType>

          <xs:complexType name="ResolverType">
               <xs:sequence>
                    <xs:element name="Param" minOccurs="1" maxOccurs="unbounded"
                         type="ParamType" />
               </xs:sequence>
               <xs:attribute name="class" type="xs:string" />
          </xs:complexType>

          <xs:complexType name="EventTypeType">
               <xs:sequence>
                    <xs:element name="StaticData" type="StaticDataType"
                         minOccurs="0" maxOccurs="unbounded" />
                    <xs:element name="Resolver" type="ResolverType"
                         minOccurs="1" maxOccurs="1" />
               </xs:sequence>
               <xs:attribute name="name" type="xs:string" />
          </xs:complexType>

          <xs:element name="Events">
               <xs:complexType>
                    <xs:choice minOccurs="1" maxOccurs="unbounded">
                         <xs:element name="EventType" type="EventTypeType"
                              minOccurs="1" maxOccurs="unbounded" />
                    </xs:choice>
               </xs:complexType>
          </xs:element>
</xs:schema>








151141

1. Added in "/home/oracle/MDS2/metadata/iam-features-passwordmgmt/event-definition/EventHandlers.xml"


<postprocess-handler class="com.ee.oim.user.NotifyUserIdToUser" entity-type="User" operation="CREATE" name="NotifyUserIdToUser" order="2180" stage="postprocess" sync="TRUE"/>




2. Added in "/home/oracle/MDS2/metadata/iam-features-passwordmgmt/notification/ResetPasswordEvent.xml"


<EventType name="NotifyUserIdToUser">
<StaticData>
<Attribute DataType="X2-Entity" EntityName="User" Name="Granted User"/>
</StaticData>
<Resolver class="oracle.iam.identity.notification.EndDateNotificationEventResolver">
<Param DataType="X2-Entity" EntityName="User" Name="usr_key"/>
</Resolver>
</EventType>

3. ./weblogicImportMetaData.sh




3. plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<oimplugins>
  <plugins pluginpoint="oracle.iam.platform.kernel.spi.EventHandler">
    <plugin pluginclass=
        "com.deepak.dubey.oim.user.NotifyUserIdToUser"
         version="1.0"
         name="NotifyUserIdToUser">
    </plugin>
  </plugins>
</oimplugins>






[oracle@voimbilt01 plugin_utility]$ ant -f pluginregistration.xml register
Buildfile: pluginregistration.xml

register:
     [echo]
     [echo] *******************************************************************************
     [echo]                                 REGISTRATION TOOL TO REGISTER
     [echo] *******************************************************************************
     [echo]             This tool can be used to register or unregister plugins to OIM.
     [echo]
     [echo]         Edit the ant.properties file to set the properties.
     [echo]         Invoke the corresponding ant targets (register or unregister) to perform registration or unregistration correspondingly.
     [echo]
     [echo]             Following are the additional system properties accepted by the utility. They would be prompted if not passed at the time of invoking the utility.
     [echo]
     [echo]             OIM.Username (User ID of the oim user)
     [echo]             ServerURL (URL of the server. t3://<host>:<port>)
     [echo]             PluginZipToRegister (Complete name with path of the plugin file. Required for registering a plugin.)
     [echo]
     [echo]             Set the other properties in ant.properties file:
     [echo]             wls.home
     [echo]             oim.home
     [echo]             login.config
     [echo]
     [echo]
     [echo] /opt/oracle/Oracle/Middleware/Oracle_IDM1/server/ext/spring.jar:/opt/oracle/Oracle/Middleware/Oracle_IDM1/server/ext/jakarta-commons/commons-logging.jar:/opt/oracle/Oracle/Middleware/Oracle_IDM1/server/ext/internal/toplink.jar:/opt/oracle/Oracle/Middleware/Oracle_IDM1/server/platform/iam-platform-context.jar:/opt/oracle/Oracle/Middleware/Oracle_IDM1/server/platform/iam-platform-utils.jar:/opt/oracle/Oracle/Middleware/Oracle_IDM1/server/platform/iam-platform-auth-client.jar:/opt/oracle/Oracle/Middleware/Oracle_IDM1/server/platform/iam-platform-pluginframework.jar:/opt/oracle/Oracle/Middleware/Oracle_IDM1/server/client/oimclient.jar:/opt/oracle/Oracle/Middleware/wlserver_10.3/server/lib/wlfullclient.jar
    [input] Enter the oim user id:
xelsysadm
    [input]Enter the oim user password:

    [input] Enter the server url [t3://<host>:<port>] :
t3://localhost:14000
    [input] Enter name (complete file name with path) of the plugin file:
/opt/oracle/deploy/plugins/notify-user.zip
     [echo]
     [echo] Plugin Registered

BUILD SUCCESSFUL
Total time: 44 seconds
[oracle@voimbilt01 plugin_utility]$

-----------------------------------------------------------------------------------------------------------------------------------------------------------
Notify UserId to User
New Account Information
Generated Password
<html>  <head>      </head>  <body>   
                    <p>
An account has been created for you with the following details. You will be required to change your password on next login.
         </p><p>
UserID: $User_Login<br>
      
         </p><p>
           For any issues, please contact admin@localdomain.com
         </p>
                     </body></html>
-----------------------------------------------------------------------------------------------------------------------------------------------------------

Modify the Existing
"Generated Password Notification"


<html>  <head>      </head>  <body>   
                    <p>
An account has been created for you with the following details. You will be required to change your password on next login.
         </p><p>
      Password: $password<br>
         </p><p>
           For any issues, please contact admin@localdomain.com
         </p>
                     </body></html>


-------------------------------------------------------------------------------------------------------------------------------------------------------------
 

OIM 11G R2 PS2 : How to generate self signed certificates and use it to for OIM to DB SSL Connectivity

ROOT CA WALLET

Navigate to the following path:
/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin

Create a wallet by using the command:
./orapki wallet create -wallet /home/oracle/wallet/root -pwd welcome1

Add a self signed certificate to the CA wallet by using the command:
./orapki wallet add -wallet /home/oracle/wallet/root -dn 'CN=root_test,C=US' -keysize 2048 -self_signed -validity 3650 -pwd welcome1

View the wallet using the command:
./orapki wallet display -wallet /home/oracle/wallet/root -pwd welcome1

Export the self signed certificate from the CA wallet using the command:
./orapki wallet export -wallet /home/oracle/wallet/root -dn 'CN=root_test,C=US' -cert /home/oracle/wallet/root/self_signed_CA.cert -pwd welcome1

DB Server Side Wallet

Create a server wallet using the command:
./orapki wallet create -wallet /home/oracle/wallet/server -auto_login -pwd welcome1

Add a certificate request to the server wallet using the command:
./orapki wallet add -wallet /home/oracle/wallet/server -dn 'CN=Customer,OU=Customer,O=Customer,L=City,ST=NY,C=US' -keysize 2048 -pwd welcome1

Export the certificate request to a file, which will be used later for getting it signed using the root CA signature:
./orapki wallet export -wallet /home/oracle/wallet/server -dn 'CN=Customer,OU=Customer,O=Customer,L=City,ST=NY,C=US' -request /home/oracle/wallet/server/server_creq.csr -pwd welcome1

Get the server wallet's certificate request signed using the CA signature:
./orapki cert create -wallet /home/oracle/wallet/root -request /home/oracle/wallet/server/server_creq.csr -cert /home/oracle/wallet/server/server_creq_signed.cert -validity 3650 -pwd welcome1

View the signed certificate using the command:
./orapki cert display -cert /home/oracle/wallet/server/server_creq_signed.cert -complete

Import the trusted certificate in to the server wallet using the command:
./orapki wallet add -wallet /home/oracle/wallet/server -trusted_cert -cert /home/oracle/wallet/root/self_signed_CA.cert -pwd welcome1

Import this newly created signed certificate (user certificate) to the server wallet using the command:
./orapki wallet add -wallet /home/oracle/wallet/server -user_cert -cert /home/oracle/wallet/server/server_creq_signed.cert -pwd welcome1

OIM - Creating Client Side Wallet

1. Create a client keystore using default-keystore.jks keystore which is populated in the following path:

cd /home/oracle/Oracle/Middleware/user_projects/domains/idmdomain/config/fmwconfig
keytool -import -trustcacerts -alias dbtrusted -noprompt -keystore default-keystore.jks -file /home/oracle/wallet/root/self_signed_CA.cert -storepass xellerate

2. Import the self-signed CA trusted certificate that you have already exported using the server side commands, to the client keystore (default-keystore.jks) by using the command:
keytool -import -trustcacerts -alias dbtrusted -noprompt -keystore default-keystore.jks -file /home/oracle/wallet/root/self_signed_CA.cert
Password - Abcd1234  (same as xelsysadm)


cd /home/oracle/Oracle/Middleware/wlserver_10.3/server/lib
keytool -import -trustcacerts -alias root_ca -noprompt -keystore cacerts -file /home/oracle/wallet/root/self_signed_CA.cert
keytool -import -trustcacerts -alias server_ca -noprompt -keystore cacerts -file /home/oracle/wallet/server/server_creq_signed.cert


Updating Oracle Identity Manager

You need to perform the following steps in Oracle Identity Manager to enable Oracle Identity Manager and Oracle Identity Manager DB in SSL mode for a secure communication:

    Import the trusted certificate into the default-keystore.jks keystore of Oracle Identity Manager.

    Log in to Enterprise Manager.

    Navigate to Identity and Access, OIM.

    Right click and navigate to System MBean Browser.

    Under Application Defined MBeans, navigate to oracle.iam, Application:oim, XMLConfig, Config, XMLConfig.DirectDBConfig, and DirectDB.

    Change the values for attributes "Sslenabled", "Url" and click Apply. If SSL mode is enabled for DB, then "Url" should contain TCPS enables and SSL port in it.

    For example:

    url="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=my.domain.com)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=proddb)))"

    Restart the Oracle Identity Manager server.

This updated the /db/oim-config.xml in the mds, checked by exporting it out.

Update the Datasources:

For oimJMSStoreDS, oimOperationsDB, mds-oim.

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=localhost.localdomain)(PORT=1522))(CONNECT_DATA=(SERVICE_NAME=orcl.localdomain)))
javax.net.ssl.trustStorePassword=Abcd1234
javax.net.ssl.trustStore=/home/oracle/Oracle/Middleware/user_projects/domains/idmdomain/config/fmwconfig/default-keystore.jks
javax.net.ssl.trustStoreType=JKS

Updating Oracle Identity Manager Authenticators

The existing Oracle Identity Manager authenticators in the WebLogic server are configured against Non-SSL DB details and they do not use datasources for communicating with Oracle Identity Manager DB. In order to use SSL DB details in the authenticators, you must perform the following:

    Ensure that Datasources are configured to SSL.

    In WebLogic Administrative console, navigate to Security Realms, myrealm, Providers.

    Remove OIMAuthenticationProvider.

    Create an authentication provider of type "OIMAuthenticator" and mark the control flag as SUFFICIENT.

    Create an authentication provider of type "OIMSignatureAuthenticator" and mark the control flag as SUFFICIENT.

    Reorder the authenticators as:

        DefaultAuthenticator

        OIMAuthenticator

        OIMSignatureAuthenticator

        Other providers if any

    Restart all servers.

Sunday, June 14, 2015

Oracle Identity Manager (OIM) 11G R2 PS3 (11.1.2.3.0) New Features

In this post, I will talk about the new features that are available in OIM 11G R2 PS3 (11.1.2.3.0)

Improved Self Service UI
In PS3 , the UI has gone a major overhaul and looks much more tablet and mobile friendly with tiles and easy access. faster navigation is what we are looking for in PS3.
There is less drop down and complicated web structure and all the items that you need are easily accessible.


Access Catalog with Guided Navigation
Complications involved in PS2 navigation are done away and now you have guided navigation feature which helps you in better understanding and manageability of your current accesses.


Temporal Grants for New and Existing Access
Users can now set start date and end date while making the requests which helps in access being given on the exact dates and also there are empowered users who can modify the grant duration as well.


Self Capabilities
PS3 comes with Self Capabilities feature that allows what action an end user can perform on themselves and on others.
This feature allows specifying rules an what all actions can be performed either on themselves or on others.


Simplified Admin Roles
These admin roles allows assigning functional capabilities to the admin role, specify members and membership rules, and organizations that the admin role members can manage.
This also makes APM obsolete and it is of no use in PS3.


Role Lifecycle Management
PS3 comes with complete end to end role life-cycle management capabilities thus making OIA obsolete.


Identity Audit Policy Management
Basically this feature performs Segregation of Duties (SoD) violation during the request process itself and checks the existing user access and also what is being requested.


Enhanced Auditing
This is a new engine which replaces older auditing engine. This one does not depend on audit snapshots and JMS and is synchronous in operation.
used by user, role, and organization management, and other components excluding provisioning


Enhanced Password Policy Management
This solves the older issue of how to password policy management when you have OIM-OAM integrated. It also allow to define challenge questions at global or at per user level.
policies can be defined at Org level.


SCIM-Based REST Services
SCIM stands for System for Cross-Domain Identity Management
and
REST - Representational State Transfer 
Both these standards allows for a industry standard approach for integrating with other identity management components or from third party vendors.
SPML XSD-based SOAP web service is deprecated with this particular feature.


Simplified Workflow Policies
This new feature replaces approval policies and provides perform better, expose additional configuration options, and conform to the UI of this release.


Simplified SSO Integration
Weblogic authenticators and plugins are deprecated and it looks like PS3 has gone in favour of older HTTP Header based SSO solution which was present in 10G release.
This allows better and simpler integration with other vendors also.