Supported Services The OPSS Java SE Client

Authorization for Java SE Applications 23-3 serviceInstance location=.bootstrap provider=credstoressp name=bootstrap.cred property value=.bootstrap name=location serviceInstance The following fragment illustrates the configuration of the necessary jpsContexts that reference the instances above: jpsContexts default=TestJSE jpsContext name=TestJSE serviceInstanceRef ref=policystore.ldap serviceInstanceRef ref=credstore.ldap jpsContext jpsContext name=bootstrap_credstore_context serviceInstanceRef ref=bootstrap.cred jpsContext jpsContexts The following code fragment illustrates how to obtain programmatically a reference to the LDAP-based policy store configured above, and it assumes that the following system properties have been set in the environment: ■ jps.policystore.hybrid.mode, set to true. ■ oracle.security.jps.config, set to the location of the file jps-config-jse.xml. String contextName=TestJSE; ... public static PolicyStore getPolicyStoreString contextName { try-block JpsContextFactory ctxFact; ctxFact = JpsContextFactory.getContextFactory; JpsContext ctx = ctxFact.getContextcontextName; return ctx.getServiceInstancePolicyStore.class; catch-block ...

23.1.3 Configuring DB-Based OPSS Security Stores

This section assumes that a DB-based store has been set to be used as the OPSS security store. For details about setting up nodes in a DB, see section Section 8.3.1, Prerequisites to Using a DB-Based Security Store. Note the following important points regarding the sample configuration below: ■ The value of the configuration property jdbc.url should be identical to the name of the JDBC data source entered when the data source was created. ■ The values of the bootstrap credentials map and key must match those passed to the WLST script addBootStrapCredential when the bootstrap credential was created. The following fragment illustrates the configuration of DB-based policy, credential, and key stores in the file jps-config-jse.xml valid only for a Java SE application: jpsConfig … propertySets propertySet name=props.db.1 property value=cn=myDomain name=oracle.security.jps.farm.name property value=DB_ORACLE name=server.type property value=cn=myRoot name=oracle.security.jps.ldap.root.name property name=jdbc.url value=jdbc:oracle:thin:myhost.com:1521srv_name