How to implement Basic Authentication support in BizTalk RosettaNet RNIFSend web page


Problem Description




Some RosettaNet user’s trading partner’s
web site requires HTTPS + Basic Authentication. In this case, they have to
customize the default RNIFSend web page to support Basic Authentication.



Problem Resolution




1.Add the
following code to CreateOuterHttpRequest method of RNIFSend.aspx.cs in
RosettaNet SDK.


= true;


string username
= System.Configuration.ConfigurationManager.AppSettings[“BasicAuthUsername”];

string password
= System.Configuration.ConfigurationManager.AppSettings[“BasicAuthPassword”];


credential = new NetworkCredential(username,

credentialCache = new CredentialCache();

“Basic”, credential);


= credentialCache;



2.Modify the
first line of RNIFSend.aspx as:


<%@ Page
language=”c#” CodeFile=”RNIFSend.aspx.cs”
Inherits=”Microsoft.Solutions.BTARN.RNIFSend.RNIFSend” %>


3.Add the following section to web.config.



<add key=”BasicAuthUsername” value=”Administrator”/>

<add key=”BasicAuthPassword” value=”Password01!”/>



4. Compile the web page and use the
following steps to deploy:

  • Create a new virtual directory
    on IIS for customized RNIFSend page.
  • Configure the vdir to use
    BTARNAppPool application pool.
  • Copy all files(RNIFSend page,
    Web.config and the Bin folder) to physical path of the new created vdir.
  • Set BasicAuthUsername and
    BasicAuthPassword in Web.config.
  • Change BizTalk send port of the
    partner from using default RNIFSend page’s url to new url of the vdir.



WenJun Zhang

Comments (1)

  1. Greg Douglas says:

    I cannot get this to work. I am getting a 404 error. Any suggestion?