Thursday, December 12, 2013

Integrate Oracle Internet Directory and Active Directory

I recently had to integrate Oracle Internet Directory and Active Directory .We used DIP from OID to integrate with AD.
Following are the high level steps for the same.

1.       Create the AD-OID synchronization profile and set up the synchronization.
2.       Updating of mapping rules for attributes that are being synced from AD to OID.
3.       Boot Strap. This step will bring all the users from AD to OID and the mapping rule should have been applied that we created already.

4.       Enable the synchronization profile for the sync to work from AD to OID.
      The detailed steps are as follows:-
1.        Create a container for example Oracle Users container with following LDIF / and ldapadd command. This command has to be executed from the oid boxes,
ldapadd –h hostname –p 3060 –D cn=orcladmin –w password–f createContainer.ldif

File – createContainer.ldif
dn: cn=OracleUsers, cn=Users, dc=xxxxx,dc=net
objectclass: top
objectclass: orclContainer
cn: OracleUsers
pwdpolicysubentry: cn=default,cn=pwdPolicies,cn=Common,cn=Products,cn=Oracle Context,dc=xxxx,dc=net
  2.       Modify ACI for new container based on ACI for cn=Users container.
                   Refer link :         http://docs.oracle.com/cd/B28196_01/idmanage.1014/b15991/aci_usrs_grps.htm#CHDCDCDD  
a)      Create the ldif file by executing the command ldapsearch –h hostname –p 3060 –D “cn=orcladmin” – w password –b “cn=Users, dc=xxxxx,dc=net” –L –s base “objectclass=*” orclaci orclentrylevelaci >users_acis_orig.ldif.
b)      In the ldif file modify the base from “cn=Users, dc=xxxx, dc=net” to “cn=Oracle, cn=Users, dc=lacmta, dc=net”  and add the changetype to modify and operation add for the 2 attributes orclaci and orclentrylevelaci .
c)       Execute the ldapmodify command. ldapmodify –v –p 3060 –h  hostname –D “cn=orcladmin” –w password
d)      Sample acis file . ZIP File. The zip contains a file called sampleacis.ldif.
3. Create AD Service Account for OID / DIP Connection to AD w/read privilege to the AD Container 
4. Check if AD Service A/c has read privilege on all users + Attributes in container to be sync'd.
5. ldapsearch -h ADhost.XXXXX.net -p 389 -D "oid_svc@XXXXX.net"  -w Oracle2ad -b "OU=Users_General,DC=XXXXX,DC=net" objectclass=*
6. OID AD Service Account details :- 
dn: CN=SVC\, OID,OU=Users_General,DC=XXXXX,DC=net
userPrincipleName: oid_svc@XXXXX.net
Password: Oracle2ad
Creation of Synchronization Profile
1. Login into Oracle FMW console at http://oidhost:7001/em using the user weblogic.
2. Expand the domain and navigate to Identity and Access.
3. Select DIP .
4. From the DIP drop down list select Administration  and then Synchronization profiles.
5. Using the Navigation Path create a new DIP sync profile with a name AD2OID. Fill in the correct AD details.

                            6. Verify that the details are correct by clicking in the Test Connection button.
                     7.       Click OK (upper right corner) to create / save the Profile
                     8..    Select AD2OID  profile and Click Edit.
                     9.     Navigate to Filtering Tab and enter 
                         Source Matching Filter – ‘searchfilter=physicalDeliveryOfficename=*’ as below. (No single quotes.)  Enter the proper search filter. My case I had to pull records  with a                                 physical delivery office name having a value.
                 11     Click ‘Test Filters’ for any errors.
                 12      If no errors found (Check ‘Source Filter Validation Message à Pass: No error).                                   13       Click Ok.

                  Update Mapping Rule
          1.  Create a mapping file for the attributes which will be synced from AD to OID.
         2.   Sample Mapping file:-

 # This file contains the sample map rules. There can be warnings as part of mapping rules validation. 
# Please correct the map rules before putting them into production environment.
DomainRules
# %USERBASE%:%USERBASE%:
ou=Users_general,dc=XXXXX,dc=net: cn=OracleUsers,cn=users,dc=XXXXX,dc=net: cn=%, cn=OracleUsers,cn=users,dc=XXXXX,dc=net
###  
AttributeRules
# attribute rule common to all objects
objectguid: :binary:top:orclobjectguid:string:orclADObject:bin2b64(objectguid)
ObjectSID: :binary:user:orclObjectSID:string:orclADObject:bin2b64(ObjectSID)
distinguishedName: : :top:orclSourceObjectDN: :orclADObject:
# sAMAccountName,userPrincipalName: : :user:orclSAMAccountName: :orclADUser:toupper(truncl(userPrincipalName,'@'))+"$"+sAMAccountname
# attribute rule for mapping Active Directory LOGIN id
userPrincipalName: : :user:orclUserPrincipalName: :orclADUser:userPrincipalName
# Map the userprincipalname to the nickname attr by default
# userPrincipalName: : :user:uid: :inetorgperson:userPrincipalName
# MTA - uid = M+physicalofficedelivery+sn
physicalDeliveryOfficeName,sn: : :user:uid: :inetorgperson:toUpper('M' + physicalDeliveryOfficeName)  + sn
# MTA - cn
physicalDeliveryOfficeName,sn: : :user:cn: :person:toUpper('M'+ physicalDeliveryOfficeName) + sn
# Map the SamAccountName to the nickname attr if required
# If this rule is enabled, userprincipalname rule needs to be disabled 
# sAMAccountName: : :user:uid: :inetorgperson
# Assign the userprincipalname to Kerberaos principalname
## userPrincipalName: : :user:krbPrincipalName: :orcluserv2:trunc(userPrincipalName,'@')+'@'+toupper(truncl(userPrincipalName,'@'))
userPrincipalName: : :user:krbPrincipalName: :orcluserv2
# This rule is mapped as SAMAccountName is a mandatory attr on AD
# and sn is mandatory on OID. sn is not mandatory on Active Directory
SAMAccountName: : :user:orclsamaccountname: : orcladuser:
sn: : :user:sn: : person:
# without which the PORTAL may not function properly 
# The next rule shows any attribute of any objectclass can be mapped
# to different attribute of different objectclass so long as the
# schema and syntax are compatible.
displayName: : :user:displayName: :inetorgperson:
givenName: : :user:givenName: :inetorgperson:
## employeeID: : :user:employeeNumber: :inetOrgPerson:
physicalDeliveryOfficeName: : :user:employeeNumber: :inetOrgPerson:
# physicalDeliveryOfficeName: : :user:physicalDeliveryOfficeName: :organizationalPerson:
title: : :user:title: :organizationalPerson:
# mobile: : :organizationalperson:mobile: :inetorgperson:
telephonenumber: : :organizationalperson:telephonenumber: :inetorgperson:
# facsimileTelephoneNumber: : :organizationalperson:facsimileTelephoneNumber: :inetorgperson:
# l: : :user:l: :organizationalperson:
# mail needs to be assigned valid value for default settings in DAS 
mail: : :user:mail: :inetorgperson:
# GROUP ENTRY MAPPING RULES
# cn: : :group:cn: :groupofuniquenames:
# displayname needs to be assigned a valid value for default settings on DAS
# SAMAccountName: : :group:displayName: :orclgroup:
# Description needs tobe assigned a valid value for default settings on DAS
# Description: : :group:Description: :groupOfUniqueNames:
# member: : :group:uniquemember: :groupofUniqueNames:
# managedby: : :group:owner: :groupOfUniqueNames:
# sAMAccountName: : :group:orclSAMAccountName: :orclADGroup:
                       
                    3.   Copy the zip fileZIP file to oid server to some location say /home/oracle.
                  4.     Execute the below command :- manageSyncProfiles update -h hostname -p 7005 -D weblogic -pf AD2OID -params "odip.profile.mapfile /home/oracle/AD/AD2OID.map"
5. Transcript of session :-                                                                                               
  manageSyncProfiles update -h xXXXXXXX -p 7005 -D weblogic -pf AD2OID -params "odip.profile.mapfile /home/oracle/AD/AD2OID.map"
[Weblogic user password]
Connection parameters initialized.
Connecting at XXXXXXXx:7005, with userid "weblogic"..
Connected successfully.
Map rules "orclodipattributemappingrules" have the following warnings:
Attribute rule "5" has warning: Source attribute ''physicaldeliveryofficename'' is optional for a required destination attribute ''cn''
Attribute rule "5" has warning: Source attribute ''sn'' is optional for a required destination attribute ''cn''
Attribute rule "6" has warning: Expecting 8 fields; found 7
                Assuming default attribute mapping rule.
Attribute rule "7" has warning: Source attribute ''samaccountname'' is optional for a required destination attribute ''orclsamaccountname''
Attribute rule "8" has warning: Source attribute ''sn'' is optional for a required destination attribute ''sn''.
Profile AD2OID successfully updated.  

Validate Profile:  
    
You can validate the AD-OID sync profile by excuting the step below.
1.       manageSyncProfiles validateProfile -h XXXXX-p 7005 -D weblogic -pf AD2OID
2.       Transcript of command from env:-
[oracle@xxxxxxxxAD]$ manageSyncProfiles validateProfile -h xxxxxxxx -p 7005 -D weblogic -pf AD2OID
[Weblogic user password]
Connection parameters initialized.
Connecting at xxxxxxx:7005, with userid "weblogic"..
Connected successfully.

Profile AD2OID has following Error(s) and/or Warning(s):

Map rules "orclodipattributemappingrules" have the following warnings:
Attribute rule "5" has warning: Source attribute ''physicaldeliveryofficename'' is optional for a required destination attribute ''cn''
Attribute rule "5" has warning: Source attribute ''sn'' is optional for a required destination attribute ''cn''
Attribute rule "6" has warning: Expecting 8 fields; found 7
                Assuming default attribute mapping rule.
Attribute rule "7" has warning: Source attribute ''samaccountname'' is optional for a required destination attribute ''orclsamaccountname''
Attribute rule "8" has warning: Source attribute ''sn'' is optional for a required destination attribute ''sn''.
3.       Ignore warnings   

           Boot Strap 

The below steps will load all the users from AD into OID.
1.       Login into the OID box and execute the below command.
2.       syncProfileBootstrap -host mtaoiddev003 -port 7005 -D weblogic -profile AD2OID_EBSID -lp 5
3.       Transcript of the command from the dev env.
[oracle@xxxxxxxAD]$ syncProfileBootstrap -host xxxxxxx-port 7005 -D weblogic -profile AD2OID -lp 5
[Weblogic user password]
Connection parameters initialized.
Connecting at xxxxxx:7005, with userid "weblogic"..
Connected successfully.

The bootstrap operation completed, the operation results are:
entries read in bootstrap operation: 7208
entries filtered in bootstrap operation: 0
entries ignored in bootstrap operation: 0
entries processed in bootstrap operation: 6187
entries failed in bootstrap operaton: 1021                                                                                   

                                                                                                                 
















Tuesday, July 23, 2013

Enable SSL for LDAPSync between Oracle Identity Manager and Oracle Internet Directory

In this post I would highlight the steps required for enabling SSL for LDAPSync between OIM and OID .

Assume that the LDAPSync is already configured using HTTP . We need to modify the LDAPSync so that it communicates over HTTPS. It is worthwhile to note that LDAPSync uses lib OVD adapters and the configuration files for the same are located at $DOMAIN_HOME/config/fmwconfig/ovd/"ContextOfAdapters" folder in the OIM domain.

The first step would be get the OID server certificate from the OID wallet. For this if the location of the wallet is known then execute the step 2 to get the certificate else look up the name of the wallet from the OID enterprise manager console.
1) Login into OID EM console.From the top, Select OID SSL instance->Oracle Internet Directory -> Administration -> Wallet. Get the OID wallet name and locate it on the server box. It is generally located at $ORACLE_OID_INSTANCE/OID/admin folder.


2) Navigate to the wallet path on the server and execute the following command to export the certificate.
$MW_HOME/oracle_common/bin/orapki wallet export -wallet [$ORACLE_INSTANCE_OID_LOCATION]/OID/admin/oidwallet -dn 'CN=serverName,OU=XX,O=XXX,L=XX,ST=XX,C=XX' -cert ./b64certificate.txt
The certificate gets exported in the b64certificate.txt file.
3) Copy this file to OIM server and import this certificate in OVD adapter keystore. The OVD adapter keystore is located at $DOMAIN_HOME/config/fmwconfig/ovd/[CONTEXT in my case conext was OIM]/keystores/adapters.jks
keytool -importcert -keystore $DOMAIN_HOME/config/fmwconfig/ovd/oim/keystores/adapters.jks -storepass XXXX -alias XXXXXXX -file /home/oracle/temp/b64certificate.txt
4) Next steps are to modify the OVD configuration using wlst commands to update the host port and the secure flag.
5) Start the WLST .
$MW_HOME/oracle_common/common/bin/wlst.sh
connect(). Enter username,password and adminserver url when prompted. 
wls:/offline> connect() Please enter your username :weblogic 
Please enter your password :
 Please enter your server URL [t3://localhost:7001] :t3://localhost:7001 
To see the list of adapters we need to modify. 
6) To see the list of adapters we need to modify execute 
wls:/IamTstDomain/serverConfig> listAdapters(contextName='oim') 
Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root. For more help, use help(domainRuntime)
Adapter Name : oid01 Adapter Type : LDAP 
Adapter Name : CHANGELOG_oid01 Adapter Type : LDAP
7) Get the details of the Adapter for the existing host name and port.Execute
getAdapterDetails(adapterName='oid01', contextName='oim) 
DETAILS OF ADAPTER :  oid1
Adapter Type                : LDAP
Name                            : oid1
Virtual NameSpace       : dc=XXX,dc=XXX
Remote NameSpace     : dc=XXX,dc=XXX
LDAP Host                   : [servername.domain :  portno]
Secure                          : false
Bind DN                     : cn=oimLDAP,cn=systemids,dc=XXX,dc=XXX
Pass Credentials            : Always
Max size of Connection Pool : 10
8) Execute the following wlst commands for modifying the first adapter.
To remove the existing the ldap host :-
removeLDAPHost('oid1','servername.domain', 'oim')
To add the new host execute the follwing command
addLDAPHost('oid1','servername.domain',portno,'oim')
Modify the secure property :-
modifyLDAPAdapter(adapterName='oid1', attribute='Secure', value=true,contextName='oim')
9)  Execute the following wlst commands for modifying the second adapter.
To remove the existing the ldap host :-
removeLDAPHost('CHANGELOG_oid1','servername.domain', 'oim')
addLDAPHost('CHANGELOG_oid1', 'servername.domain',portno, 'oim')
modifyLDAPAdapter(adapterName='CHANGELOG_oid1', attribute='Secure', value=true,contextName='oim')
10)Verify that the proper details are updated in adapters.os_xml  located at $DOMAIN_HOME/domains/DOMAIN_HOME/config/fmwconfig/ovd/oim .
Look for the following tags in adapters.os.xml and see that the following values are correct.
 <hosts>
            <host readonly="false" percentage="100" port="portno">servername.domain</host>
        </hosts>
        <remoteBase>dc=XXX,dc=XXX</remoteBase>
        <secure>true</secure>
11)Restart the OIM managed and Admin servers.



Friday, June 14, 2013

BPM Single Sign on with Oracle Access Manager 11g

OAM 11g - BPM Integration

This blog highlights the steps required for enabling single sign on BPM components of SOA Suite It assumes that OAM 11g was already in place and was being used as the enterprise solution for single sign on.Following are the high level steps to achieve the SSO for BPM.

Prerequisites
1.                OAM, OHS and WebGate Installed and configured.

2.                WebGate registered with OAM .

Detail Steps
Register resources with the URL’s you want to protect.
Log into OAM Console.

Policy Configuration -> Application Domains -> Application Domain Name-> Resources -> Open


Create – ‘New Resource’

Define following Resources, based on the common parameters:
-                   Resource Type – HTTP
Host Identifier – WebgateHostName Can be found from Shared components->HostIdentifiers Tab.

BPM contribution Resources:-

Resource URL
Protection Level
Authentication Policy
Authorization Policy
/bpm/composer
Protected
Protected Resource Policy
Protected Resource Policy
/bpm/workspace
Protected
Protected Resource Policy
Protected Resource Policy
/integration/worklistapp
Protected
Protected Resource Policy
Protected Resource Policy
/integration/worklistapp/…/*
Protected
Protected Resource Policy
Protected Resource Policy



Once complete, you should see following resources in the Resources Screen




Next Step is to configure an OAM Identity Asserter and OID/OVD provider in Weblogic. 
1.                Define OAM Identity Asserter in BPM Admin
a.                Lock & Edit
b.               Security Realms -> myrealm -> Providers
c.                New  Provider
Name – OAM Identity Asserter
Type  -   OAMIdentityAsserter
OK.

You will go back to the Provider List
d.               Click ‘OAM Identity Asserter’
Control Flag – REQUIRED
Move Active Types to Chosen -> OAM_REMOTE_USER and ObSSOCookie
Save. 
Click on provider specific to OAM servers and OAM servers header name.

In our case we were OID as user store hence we configured OID authenticator.
Create new identity asserter OID Authenticator. Choose type as OIDAuthenticator. Click on provider specific. Fill in the following details





User Base DN:
cn=users,dc=dev
All Users Filter:
(&(cn=*)(objectclass=person))
User From Name Filter:
(&(cn=%u)(objectclass=person))
User Search Scope:
subtree
User Name Attribute:
cn
User Object Class:
person
Group Base DN:
cn=groups,dc=dev
All Groups Filter:
(&(cn=*)(|(objectclass=groupofUniqueNames)(objectclass=orcldynamicgroup)))
Group From Name Filter:
(|(&(cn=%g)(objectclass=groupofUniqueNames))(&(cn=%g)(objectclass=orcldynamicgroup)))
Group Search Scope:
Subtree
Group Membership Searching:
unlimited

a.                Click ‘OID Authenticator’
Control Flag – SUFFICIENT
Save.
Go back to the Provider List
b.               Click ‘Reorder’
Move ‘OAM Identity Asserter’ to the top of the list, then OID Authenticator


Activate the changes and restart the servers.
Next step would be to configure OHS server.
Add an entry in the conf files like below.Create a dns in your network load balancer or for local testing purpose add an entry in the hosts file so that soabpm.dev.org points to the OHS server.
NameVirtualHost *:7777
<VirtualHost *:7777>
ServerName soabpm.dev.org:7777
ServerAdmin ak@ak.com
RewriteEngine On
RewriteOptions inherit
UseCanonicalName On
<Location /integration/worklistapp>
SetHandler weblogic-handler
WebLogicHost BPM Server
WebLogicPort BPM server port
</Location>
</VirtualHost>
Restart OHS.

Test SSO either by accessing the url http://soabpm.dev.org:7777//integration/worklistapp
or directly access the http://ohs_server_url:7777//integration/worklistapp

It is assumed that the OAM settings like creating authentication schemes, providing a login page url,defining identity store (make sure the identity store configured in OAM is same as the ine which we configure in BPM servers) ,creating a protected authentication  resource policy, protected authorization resource policy are already taken care. Or you may refer oracle documentation for these.