In the previous blog post, we went over how to pass authentication information for WCF SQL, WCF Oracle DB, WCF SAP and WCF Siebel adapters. WCF Oracle E-Business adapter poses some additional challenges since in some case two sets of credentials – one for the Oracle DB and one for the Oracle E-Business server – may be required. Below are few options that can be used to authenticate in such scenarios.

Using custom endpoint behavior

The approach is exactly the same as defined in the previous blog post. In addition to retrieving the Oracle DB credentials and populating the ClientCredentials behavior, we will additionally retrieve the Oracle E-Business credentials and populate the relevant binding properties with that information.  

        public void
            ApplyClientBehavior(
                ServiceEndpoint endpoint,
                ClientRuntime clientRuntime
            )
        {
            ClientCredentials clientCredentials = endpoint.Behaviors.Find<ClientCredentials>();
            Debug.Assert(clientCredentials != null, “ClientCredentials behavior not present”); 


           
// TODO: Add your code to retrieve the credentials from a secure 
            //       store. For illustration purpose, the values are hard-coded
            clientCredentials.UserName.UserName = “Foo”;
            clientCredentials.UserName.Password = “Bar”; 


           
// TODO: Add your code to retrieve the credentials from a secure 
            //       store. For illustration purpose, the values are hard-coded
            PropertyInfo oapUsername = endpoint.Binding.GetType().GetProperty(“OracleUserName”);
            Debug.Assert(oapUsername != null, “OracleUserName binding property not present”);
            oapUsername.SetValue(endpoint.Binding, “FooApps”, null);
            PropertyInfo oapPassword = endpoint.Binding.GetType().GetProperty(“OraclePassword”);
            Debug.Assert(oapUsername != null, “OraclePassword binding property not present”);
            oapPassword.SetValue(endpoint.Binding, “BarApps”, null);
        }


Putting the credentials in the configuration file

The Oracle E-Business credentials can be specified by setting the binding properties – oracleUserName and oraclePassword – in the configuration file. Note that this poses a security risk since the credentials are now stored in clear text in the config file. You need to ACL that file properly.

The Oracle DB credentials can be specified using any of the mechanisms specified in the previous blog post.


Sandeep Prabhu,
BizTalk Server Team