In this blog post I will share steps for performing a loopback test of OAM Federation 11.1.2.3. In a loopback test, we configure OAM’s SP to point to OAM’s IdP. This enables you to confirm the basic functionality of OAM Federation without requiring any external partner server. I also find it useful in plugin development – you can perform initial development of your plugin using just the OAM Federation server, since you might not have an instance of the intended partner server available in your development environment.
You can find instructions here on how to do the same thing in OIF 11.1.1.x federation. (Those instructions are for Fusion Apps, however the loopback test itself is identical for non-Fusion Apps environments.) You’ll find the steps in OAM 11.1.2.3 are very similar, the main difference being that OAM 11.1.2.3 uses OAM Console for configuration rather than Enterprise Manager. Also, while I have provided steps for OAM 11.1.2.3, the steps in 11.1.2.2 are very similar (the configuration screens themselves are similar, but the navigation paths to reach them are different).
A couple of prerequisites:
- you need OAM 11.1.2.3 installed. I used the Lifecycle Management Tools Deployment Wizard — see 11.1.2.3 IAM Deployment Guide
- you need the “Identity Federation” service enabled. If it is not already enabled, you can go to oamconsole > Configuration tab > Available Services. (Hint: if it is disabled yet the “Enable Service” link is greyed out, try disabling then re-enabling “Mobile & Social”).
Download the metadata
OAM’s IDP metadata is available using the URL: http://OAMHOST:OAMPORT/oamfed/idp/metadata
Download that and save it to a file.
You can also download the SP metadata from the URL: http://OAMHOST:OAMPORT/oamfed/sp/metadata
However, what you will discover, is they are basically the same thing, with only the ID, timestamps, and digest/signature values different. To see this, run each XML file through xmllint –format, and then diff the results.
Hence, in OAM Federation’s case, we can treat the two sets of metadata interchangeably, and only need to save the one file.
Next we need to create LoopbackIDP
oamconsole > Federation tab > under “Federation” select “Service Provider Management”
Click on “Create Identity Provider Partner”:
Fill in the following data:
- Name: “LoopbackIDP”
- “Enable Partner” will be checked by default
- Select protocol “SAML2.0”, browse to the metadata XML file you saved previously
- Under “User Identity Store” you can select “OAMIDSTORE”.
- You can leave the other mapping settings, e.g. “Map assertion Name ID to User ID Store attribute”, to their defaults. Basically, you can use whatever attribute you want, provided you have that attribute defined and unique for your test users, and you make the same configuration at the other end.
Click Save – LoopbackIDP will be created.
Now to test this, let’s use the SP test page:
The SP Test page can be accessed via: http://OAMHOST:OAMPORT/oamfed/user/testspsso
initially this screen will display “System Error”.
If you look at the logs (e.g. wls_oam1-diagnostic.log) you will see:
oracle.security.fed.event.EventException: SP Engine error - the Test SP Engine is not enabled at oracle.security.fed.eventhandler.fed.authn.engines.testsp.TestSPRetrieveInformationEventHandler.perform(TestSPRetrieveInformationEventHandler.java:77)
Solution: you need to run the configureTestSPEngine("true") command in WLST:
- Start WLST:
$IAM_ORACLE_HOME/common/bin/wlst.sh
- Note that there are multiple copies of WLST installed. You need to use the copy under the $IAM_ORACLE_HOME, since that copy has the configureTestSPEngine() command configured. The other copies of WLST installed in the other homes (oracle_common, wlserver_10.3) will lack this command, and the other OAM-specific commands.
- Connect to the WLS Admin server: connect()
Enter the username (e.g. weblogic) ,password & Admin Server URL (e.g. t3://myadminserver.example.com:7001 )
- Navigate to Domain Runtime branch: domainRuntime()
- Execute the configureTestSPEngine() command: configureTestSPEngine(“true”)
Now we try again:
Choose partner “LoopbackIDP” and “Start SSO”.
Once again we get a “System Error”. Looking at the logs:
<Error> <oracle.security.fed.jvt.JVTDiscoveryManager> <FEDSTS-12014> <Discovery Finder Exception: unable to locate object in the repository: {0} oracle.security.fed.jvt.discovery.exceptions.DiscoveryFinderException: Missing partner configuration for: http://OAMHOST:OAMPORT/oam/fed at oracle.security.fed.jvt.discovery.model.config.ConfigServiceDiscoveryProvider.getPartnerConfig(ConfigServiceDiscoveryProvider.java:1043) at oracle.security.fed.jvt.discovery.model.config.ConfigServiceDiscoveryProvider.locateProtocolConfiguration(ConfigServiceDiscoveryProvider.java:910) at oracle.security.fed.jvt.discovery.model.config.CSFConfigDiscoveryProvider.locateProtocolConfiguration(CSFConfigDiscoveryProvider.java:134) at oracle.security.fed.jvt.discovery.model.config.ChainingConfigDiscoveryProvider.locateProtocolConfiguration(ChainingConfigDiscoveryProvider.java:42) at oracle.security.fed.jvt.discovery.model.config.CachingConfigDiscoveryProvider.locateProtocolConfiguration(CachingConfigDiscoveryProvider.java:75) at oracle.security.fed.jvt.JVTDiscoveryManager.locateProtocolConfiguration(JVTDiscoveryManager.java:1956)
This is because we have configured “LoopbackIDP” as an IDP partner in the SP configuration, but we have not configured the SP as an SP partner in the IDP configuration. Let us do that now:
Next we need to create LoopbackSP
oamconsole > Federation tab > under “Federation” select “Identity Provider Management”
Click on “Create Service Provider Partner”:
Fill in the following data:
- Name: “LoopbackSP”
- “Enable Partner” will be checked by default
- Select protocol “SAML2.0”, browse to the metadata XML file you saved previously
- For “NameID Format” you can use the default of “Email Address”. For “NameID Value” you can use “User ID Store Attribute” of “mail”.
- Other settings can be left at their defaults.
Click Save – LoopbackSP will be created.
Now let’s repeat the test with the test SP app:
Having tested this with an SP app, we can now do the same test using a protected page:
- In oamconsole, go to Federation tab, Federation tile, Service Provider Management
- Search for LoopbackIDP and open it
- Click “Create Authentication Scheme and Module”
This will create an Authentication Module called LoopbackIDPFederationPlugin and an Authentication Scheme called LoopbackIDPFederationScheme
- Go to your OHS htdocs directory — if you used LCM installation, this is $IDMTOP/config/instances/ohs1/config/OHS/ohs1/htdocs
- Create a directory called fedtest
- Inside fedtest create a file called index.html, add some content e.g. “<h1>Hello World!</h1>”
- In OAM Console, go to “Application Security” tab, “Access Manager” tile, “Application Domains” link:
- Then press “Search”:
- Open “IAM Suite”:
- Go to “Authentication Policies” tab, and click “Create”:
- On the “Create Authentication Policy” screen, enter name “LoopbackIDPAuthPolicy” and select “Authentication Scheme” of “LoopbackIDPFederationScheme”. Then click “Apply”.
Go back to the “IAM Suite” tab, then select the “Resources” subtab. Click “Create”:
Choose resource type of “HTTP”, host identifier of “IAMSuiteAgent”, Resource URL of /fedtest/…/*
And protection level of “Protected”, with “Authentication Policy” of “LoopbackIDPAuthPolicy” and “Authorization Policy” of “Protected Resource Policy”
Click Apply
- Now finally to test: open a new Private Browsing Window, and navigate to http://OAMHOST:OAMPORT/fedtest/index.html . You should get redirected to the login page, and you should see /oamfed/idp/samlv20 in the address bar of the login page. This shows we are using SAML. Then login and you should see the message “Hello World!”
All content listed on this page is the property of Oracle Corp. Redistribution not allowed without written permission