Wednesday, March 15, 2017

DCC: 404 NOT FOUND while accesing oamfed resource urls

Receiving the  "404 NOT FOUND" error while accessing the /oam, /oamfed resources or oam based resources through DCC (Detached credential collector) Webgate enabled webserver and shows no error logs on webserver except in access logs as 404.

For ex: http://<DCCHost>:<DCCPORT>/oamfed/idp/metadata

Environment:  
  • OAM 11.1.2.3
  • OHS 11.1.1.7
  • OAM Webgate 11.1.2 
  • RHEL 6/OEL 6 

Error:




 Cause:
  
This is due to missing configuration in the webgate. Need to add the list tunneled URLs explicitly that need to be served by DCC Webgate.

Fix:

  • Login to OAM Console and navigate to the DCC Webagte configuration
  • Add the below URLs as "TunneledUrls" in the webgate user defined parameter section and save the webgate configuration
    • /oam
    • /oamfed


  • Redeploy the newly generated webgate artifacts from <OAMDomain_Home>/output/<webgate>/  to the webgate/config/ folder in the webserver
  • Restart the webserver and try again.  

For more information regarding dcc implementations with federation, Please refer to my earlier posts on the OAM DCC configuration settings.
  Thanks for visiting

Tuesday, March 14, 2017

OUD Instances Out of Sync ??

                 In the world of replication between nodes across data centers, there are chances of having some node failures due to power outages, disk issues or for several other reasons. These issue might result in the data going out of sync between the nodes.

So how do we fix it ???

            There are several approaches that we usually take depending on the amount of data lost, data quality etc and several other factors.. Now in this post we are going to sync the data using the Manual approach assuming there is only minor loss of data which can be fixed manually...

Below are the high level steps which we are going to take in order to fix this data inconsistency.
  • Find the OUD server which is stable. In this post, referring as oud1 in the post. 
  • Find the OUD server which is out of sync with stable server. refering as oud2. 
  • Export entries from oud1 and oud2 and compare
  • Export missing entries and data from oud1
  • Import the missing entries and data into oud2
Environment:
  • OUD 11.1.2.3 
  • RHEL 6 
Steps:

  • Export entries from oud1 using ldapsearch
Run below ldapserach command to write entries into file. by default ldapsearch utility will be available in <oud_instance>/bin folder. Here OUD1 is the best instance and OUD2 is the instance which is out of sync.

ldapsearch -h <oud1_hostName> -p <Port> -D "cn=Directory Manager" -j <Password_File> -b "dc=base,dc=com" "objectclass=*" dn | sort > oud1_entries.txt


Sample:-(oud1_entries.txt):-
dc=com
dc=base,dc=com
dn: cn=group1,ou=users,dc=base,dc=com
dn: cn=group2,ou=users,dc=base,dc=com
dn:.....
dn:.....
dn: cn=Test User1,ou=users,dc=base,dc=com
dn: cn=Test User2,ou=users,dc=base,dc=com
dn:.....
dn:.....


P.S: When you open a file it might look empty but please scroll down and verify entries are available.

  • Export entries from oud2 using ldapsearch
ldapsearch -h <oud2_hostName> -p <Port> -D "cn=Directory Manager" -j <password_file> -b "dc=base,dc=com" "objectclass=*" dn | sort > oud2_entries.txt

Sample:-(oud2_entries.txt):-
dc=com
dc=base,dc=com
dn: cn=group1,ou=users,dc=base,dc=com
dn:.....
dn:.....
dn: cn=Test User1,ou=users,dc=base,dc=com
dn:.....
dn:.....


P.S: When you open a file it might look empty but please scroll down and verify entries are available.
  • Compare two files from oud1 and oud2
Use below command to diff to compare the files and write the missing entries into a file.

diff oud1_entries.txt oud2_entries.txt > missing_entries.txt

Sample:-(missing_entries.txt):-
dn: cn=group2,ou=users,dc=base,dc=com
dn:.....
dn:.....
dn: cn=Test User2,ou=users,dc=base,dc=com
dn:.....
dn:.....


Use grep or other tools to remove first two lines (dn:) in missing_entries.txt and sample file should looks like below.

Sample:-(missing_entries.txt):-
cn=group2,ou=users,dc=base,dc=com
cn=....
cn=Test User2,ou=users,dc=base,dc=com
cn=....


  • Export ldif data (with attributes) from oud1 for the missing entires. 
create export_missing_dn.sh file and update the content with below.

cat missing_entries.txt | while read LINE
do
echo "Processing $LINE" <oud_instance>/bin/ldapsearch -h <oud1_hostname> -p <port> -D "cn=Directory Manager" -j <password_file> -b "$LINE" -s base "objectclass=*" dn "*" + >> export_missing_dns.ldif
done


Run export_missing_dn.sh, it should create a file with name, export_missing_dns.ldif. Open the file and make sure there format of ldif is correct before importing.

  • Import the ldif into oud2 
Import the ldif into oud2 using ldapmodify

ldapmodify -J 1.3.6.1.4.1.26027.1.5.2 -h <oud2_hostname> -p <port> -D "cn=Directory Manager" -j <pwd_file> -f export_missing_dns.ldif

That's all. Now your instances are in sync..

Thank you for visiting.

Tuesday, February 28, 2017

SP Initiated SSO to Salesforce

                        In this post we are going to cover the configuration steps on how to enable the Service Provider(SP) initiated Federated SSO to Salesforce with OAM 11.1.2.3. I have covered about Single Sign-on to Salesforce using OAM 11.1.2.3 in IDP initiated mode in one of my earlier posts. This will will be continuation to those posts.
                        
                       Once you finish the steps mentioned in earlier posts, You just have to finish the below steps to configure the SP initiated SSO to Salesforce. As described earlier, I have configured my OAM as IDP and Salesforce as SP. In this example, Request for authentication initiates from Salesforce(SP) and redirects it to OAM(IDP) which is nothing but the SP Initiated Single Sign-On.

Example: 

  • End-user having accounts on IDP(OAM) and SP(salesforce) side with email as user login.
  • End-user will access salesforce URL directly.
  • End-user will be authenticated with IDP side credentials and will federate the user back to Salesforce.
Pre-requisites:
  • Install and configure OAM 11.1.2.3
  • Configure Authentication store for OAM. In my lab, I have configured OUD as authentication store
  • Front-end OAM with OHS and protect with OAM

 Environment:
  • OAM 11.1.2.3 BP07
  • RHEL6
  • Salesforce
  • OUD 11.1.2.3
  • OHS 11.1.1.7 
 Steps:
  • Make sure a domain created for your salesforce instance. In our example, Let is consider it as "https://devfed.my.salesforce.com
  • If domain is not created, created one by navigating as given below
    • Settings -> Setup -> Company Settings -> My Domain
  • Once the domain is enabled and deployed, Click on Edit to configure the Authentication provider.
  • Select the Single sign-provider  that your imported earlier as authentication provider now.
  • Save the Changes.
  • Now search for Single Sign-On Settings and open the current configured SSO Provider.
  • Configure the Identity Provider Login URL with your IDP Initiated URL. This is the same  OAM protected IDP Initiated Federation URL.
  • That's all folks. Now you finished additional configuration required for SP Initiated SSO to Salesforce.
  • Lets validate this now.
 Validation :
  • Access your Salesforce domain URL directly in the browser.
  • This should redirect you back to your configured IDP URL as shown below.
  • If you look at the above screenshot, you can see SAML Authentication request initiated from Salesforce(SP) and redirected to OAM IDP URL.
  • Enter your IDP credentials and click on Login button.
  • After successful authentication,  OAM responds back with SAML Response and posts it to Salesforce.
  • Similar to IDP initiated SSO, Salesforce will validate the SAML response message and redirect the user to home page.
  • You can view the SAML response highlighted in below screenshot.

  •  You are now landed onto Salesforce with the user you authenticated against IDP.
 Thank you for visiting.