Creating referral policies in openam through ssoadm

495 Views Asked by At

In openam I created a subRealm named TestRealm .In order to create policies in TestRealm there should be a referral policy. Im trying to create a policies for TestRealm with the help of ssoadm command, but its throwing a error Cannot create policy. No referral exists to the organization. Im using the following policy.xml to create policies under the root realm.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Policies PUBLIC "-//OpenSSO Policy Administration DTD//EN" "jar://com/sun/identity/policy/policyAdmin.dtd">
<!-- New policy, same as the old policy -->
<Policies>
  <Policy name="Test Policy" referralPolicy="false" active="true" >
    <Rule name="Test Allow GET with parameters">
      <ServiceName name="iPlanetAMWebAgentService" />
      <ResourceName name="http://www.test.com/demo/*?*" />
      <AttributeValuePair>
        <Attribute name="GET" />
        <Value>allow</Value>
      </AttributeValuePair>
    </Rule>

    <Rule name="Vidz Ref Allow GET and POST">
      <ServiceName name="iPlanetAMWebAgentService" />
      <ResourceName name="http://www.test.com/demo/*" />
      <AttributeValuePair>
        <Attribute name="POST" />
          <Value>allow</Value>
      </AttributeValuePair>
      <AttributeValuePair>
        <Attribute name="GET" />
        <Value>allow</Value>
      </AttributeValuePair>
    </Rule>

    <Subjects name="Subjects" description="Everybody authenticated">
       <Subject name="All Authenticated Users" type="AuthenticatedUsers" includeType="inclusive">
       </Subject>
    </Subjects>
 </Policy>
</Policies>

How to modify the above one to create a referral policy??

1

There are 1 best solutions below

1
On BEST ANSWER

The easiest way would be to simply create an example referral in the top level realm, and then just export it via ssoadm for subsequent imports. Also you should use very generic rules in referrals, like http://www.test.demo.com/* and http://www.test.demo.com/*?*, having complex rules in referrals will only slow down policy evaluation without much of a point (the referred policies will be used to make the allow/deny decision in the end anyways).