Previous topic  Top  Next topic  Print this Topic
 

Configuration of the Security Context

 

The "conf" folder contains a file "security-context.xml". This configuration file allows the specification of the realms which should be used and the authentication strategy.

Properties Realm

The simplest scenario is to define users, their passwords and roles in a text file. For this scenario the XML file looks like:

<source lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <beans>

  <bean id="OntoBrokerSecurityManagerConfig" class="com.ontoprise.security.OntoBrokerSecurityManagerConfig">

    <property name="realms">

        <list>

          <ref local="PropertiesRealm"/>

        </list>

    </property>

    <property name="authenticationStrategy">

        <bean class="org.apache.shiro.authc.pam.FirstSuccessfulStrategy"/>

    </property>

 

</bean>

<bean id="PropertiesRealm" class="com.ontoprise.security.realm.PropertiesRealm"> <property name="resourcePath"><value>security.properties</value></property> </bean> </beans> </source>

The last few lines specify the path to the text file with the user configuration: "security.properties". The next section contains an example for the content of a "security.properties" file.

Security Module Realm

The security-context.xml file for the security module realm is

<source lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <beans>

  <bean id="OntoBrokerSecurityManagerConfig" class="com.ontoprise.security.OntoBrokerSecurityManagerConfig">

    <property name="realms">

        <list>

          <ref local="PropertiesRealm"/>

          <ref local="SecurityModuleRealm"/>

        </list>

    </property>

    <property name="authenticationStrategy">

        <bean class="org.apache.shiro.authc.pam.FirstSuccessfulStrategy"/>

    </property>

 

</bean>

 

<bean id="SecurityModuleRealm" class="com.ontoprise.security.realm.SecurityModuleAuthorizationRealm"> </bean>

<bean id="PropertiesRealm" class="com.ontoprise.security.realm.PropertiesRealm">

<property name="resourcePath"><value>conf/security.properties</value></property> </bean> </beans> </source>

 

Note that also the properties realm configuration is included because it is (currently) not possible to specify passwords in the security module realm. When the inference server starts up and you configured the security module realm you should see something like

INFO [CONFIG] Loading security ontology: file:/C:/OntoBroker/conf/$security.obl