Search code examples
biztalkbiztalk-2009

How to add a masked password property to a BizTalk custom file adapter?


I've built a custom file adapter using the sample found in the BTS 2009 SDK, but I need to receive files via this adapter using credentials other than what the host instance is running under. I'd like to add 2 properties to the properties window of the adapter for username and password (this I know how to do), but I want to hide the password text on the password property. Does anyone know how to go about this? Is there something I can set in the ReceiveLocation.xsd on the property to let it know it's for a password, similar to TextBox.PasswordChar property?


Solution

  • I needed to use the Biztalk Adapter Framework PasswordUITypeEditor and PasswordTypeConverter components in the ReceiveLocation.xsd like so:

     <xs:element name="Password">
              <xs:simpleType>
                <xs:annotation>
                  <xs:appinfo>
                    <baf:designer>
                      <baf:displayname _locID="passwordName">Password</baf:displayname>
                      <baf:description _locID="passwordDesc">Enter username for authentication to directory</baf:description>
                      <baf:editor assembly="%BTSROOT%\\Developer Tools\\Microsoft.BizTalk.Adapter.Framework.dll">Microsoft.BizTalk.Adapter.Framework.ComponentModel.PasswordUITypeEditor</baf:editor>
                      <baf:converter assembly="%BTSROOT%\\Developer Tools\\Microsoft.BizTalk.Adapter.Framework.dll">Microsoft.BizTalk.Adapter.Framework.ComponentModel.PasswordTypeConverter</baf:converter>
                      <baf:category _locID="authenticationCategory">Endpoint Directory Authentication</baf:category>
                    </baf:designer>
                  </xs:appinfo>
                </xs:annotation>
                <xs:restriction base="xs:string">
                  <xs:maxLength value="22" />
                </xs:restriction>
              </xs:simpleType>
            </xs:element>