Geeks With Blogs
Paul's Petrov Whiteboard [BizTalk, Enterprise Application Integration, Business Process Automation, SOA, .NET]

Richard Seroter published useful utility to store/retrieve BizTalk configuration settings in Enterprise SSO database. I added some more functionality to it.

First, I added Export/Import functions allowing to actually save values in the external XML file (Richard's implementation allowed storing only field names, calling for extra work should you delete and restore SSO aplication). I kept file format the same but added values stored as text nodes:

 

<sso>
  <application name="eCommerce.BizTalk.Configuration">
    <description>Configuration storage for eCommerce BizTalk applications</description>
    <appUserAccount>BizTalk Application Users</appUserAccount>
    <appAdminAccount>BizTalk Server Administrators</appAdminAccount>
    <contactInfo>http://geekswithblogs.net/paulp</contactInfo>
    <field ordinal="0" label="App1.SiteId" masked="no">2</field>
    <field ordinal="1" label="App1.UserId" masked="no">8</field>
    <field ordinal="2" label="App2.Timeout" masked="no">5000</field>
    <flags configStoreApp="yes" allowLocalAccounts="yes" enableApp="yes" />
  </application>
</sso>

 

New usage scenarios:

1. Saving configuration:

1.1 Create application; 
1.2 Save to XML; 
1.3 Manage application - Retrieve settings; 
1.4 Export to XML file created in (1.2).

2. Restoring previously saved configuration: 

2.1 Create application;
2.2 Manage application - Import configuration from file created in (1.4) ; 
2.3 Save Changes.

Accordingly, menu items Import/Export available when the Manage Application tab is selected only.

The code can be downloaded here.

Posted on Friday, May 16, 2008 3:54 PM .Net , BizTalk , EAI | Back to top


Comments on this post: Improved SSO Configuration Data Store Tool

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Hi Paul,

This enhanced tool is great. Few questions:

1. When I click the "Select Application" button in the Manage Application tab, it tells me "no application found", even though I enter the application created prior to use this tool. I interpret that button as for selecting one of many Applications or take the one I entered in the Application name textbox. Do I miss something here?

2. In situation when the config XML file was not available, could it possible to recreate it from either tab on the Win Form, or could it possible the Export Configuraiton function not relying on pre-existing config XML file? This might be another feature to this great tool.

Thanks for the Great Job!
Michael
Left by Michael J. on Jul 10, 2008 1:41 PM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Michael,

Select Application supposed to show the list of available applications in database. But as explained in the last paragraph, I was not able to resolve this problem and left it dangling. I think I need to disable it until solution found not to confuse users.

If you have application in store and no XML file, you can export setting using Manage Application tab: 1. Type app name and click Retreive Settings. 2. Select File - Export Configuration menu.

Thanks,
Paul
Left by Paul Petrov on Jul 11, 2008 8:55 AM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Paul,

Thanks for the confirmation. The revised version is working great overall. However, I run into an issue when I try to "Load Configuration From XML" into the multiple servers in domain environment. The configure xml file is similar to your sample.

At first, it complains "The Application Users account is not valid for application update.". Then, I add the full domain user name to the value of <appUserAccount> and <appAdminAccount> elements, like "domain_name\BizTalk Application Users". When I try load configuration from this xml, I got below error. So, I tried to delete the SSO Application and re-load configuration from the same XML, but I still got error. The "reserved" is the first dummy field[0]. Any suggestion?

Thx,
Michael

====== Error text ======

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentException: Item has already been added. Key in dictionary: 'reserved' Key being added: 'reserved'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Specialized.HybridDictionary.Add(Object key, Object value)
at BizTalk.Tools.SSOStorage.ApplicationManager.btnCreateApp_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
BizTalk.Tools.SSOStorage
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/CAPS/Tools/BizTalk.Tools.SSOStorageRevised.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.EnterpriseSingleSignOn.Interop
Assembly Version: 5.0.1.0
Win32 Version: 6.0.0245.0
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.EnterpriseSingleSignOn.Interop/5.0.1.0__31bf3856ad364e35/Microsoft.EnterpriseSingleSignOn.Interop.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Left by Michael J on Jul 22, 2008 12:45 PM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Michael,

I don't know why it shows "reserved" as in code it's hardcoded as "dummy" string. As for reloading configuration from the XML make sure you follow recommended sequence and that you're running under the account that belongs to the domain group you claimed under App Admint Account field for the particular application.

Sorry for not responding earlier, I just discovered your post. Hope you solved that issue.

Best,
Paul
Left by Paul Petrov on Nov 19, 2008 3:07 PM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Paul,
This is a great tool. There are couple of solutions for loading applications from SSO store. Simplest one is to call the stored procedure ssox_spGetApplications.
Regards,
Krishna
Left by Krishna Jammula on Dec 02, 2008 2:38 PM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
appreciate ur work. managed to fix the select app so that it'll return a list of config apps... figured i'd contribute a little in case you haven't resolved it yet.

you have to set the flags/flagmask before calling getapplications.


ISSOMapper ssoMapper = new ISSOMapper();

AffiliateApplicationType appTypes = AffiliateApplicationType.ConfigStore;
appTypes |= AffiliateApplicationType.All;

IPropertyBag propBag = (IPropertyBag)ssoMapper;

uint appFilterFlagMask = SSOFlag.SSO_FLAG_APP_FILTER_BY_TYPE;
uint appFilterFlags = (uint)appTypes;

object appFilterFlagsObj = (object)appFilterFlags;
object appFilterFlagMaskObj = (object)appFilterFlagMask;

propBag.Write("AppFilterFlags", ref appFilterFlagsObj);
propBag.Write("AppFilterFlagMask", ref appFilterFlagMaskObj);


string[] apps = null;
string[] descs = null;
string[] contacts = null;

ssoMapper.GetApplications(out apps, out descs, out contacts);

Left by anon on Dec 03, 2008 8:31 PM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Thanks! I uploaded new version including your fix and some UI changes.
Left by Paul on Dec 05, 2008 12:16 AM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Thanks for adding these features to the tool. I'm a colleague of Richard Seroter, and so I've always used that version until I got tired of re-creating the fields every time I needed to add a new config parameter. Your tool works great. I like the Browse SSO function too...

Thanks for adding these features! I know I'm going to use this tool a lot.

--Victor
Left by Victor Fehlberg on Apr 24, 2009 3:44 PM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
I'm glad you find it helpful. Also check out custom MSBuild task for SSO configuration deployment: http://geekswithblogs.net/paulp/archive/2008/06/09/122746.aspx. It is very handy when doing automated BizTalk build/deployment.

Thanks,
Paul
Left by Paul on Apr 26, 2009 11:21 AM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Paul

Thanks for making these changes to a great tool.

Downloaded the latest (Oct/12/2010) build and found the following issues:

1) The .exe's in Release and Debug are different (have different functionality). For example the Release version has the "Browse" button whereas the Debug version doesn't.

2) The "Release" build's "Export Configuration" menu option pops an "Open" file dialog not a "Save File" dialog so I can't save the configuraiton as you describe.

3) Trying to open the source solution keeps giving me an error message (this may be a VS set up problem on my part - still investigating).

Anyway, bottom line is that right now I can't save the configuration and I can't modify the code since I can't currenlty open it on my machine.

FWIW,
Rod
Left by Rod da Silva on Nov 26, 2010 7:38 AM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Thank you for being a great time saver, Same issue as Rod, but also under the manage tab if i add a new property/value in the grid, when i hit save settings, it does not save it. Also if i modify the name of a property, that property disappears after hitting save settings instead of showing the corrected value. Let me know if i am doing something wrong?
Left by Atif on Oct 02, 2012 8:18 AM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Hi,

Thanks for the great tool.

I discovered a small issue: When using XML like data (e.g. an RSA key) it will become HTTP encoded when you run 'Export Configuration' (which is perfect). But when you run 'Import Configuration' the field values are read as-is (no HTTP decode).

I changed a line in ApplicationManager.cs (l. 349):

//row.Cells[1].Value = dict[key];
decodedValue = HttpUtility.HtmlDecode(dict[key]);
row.Cells[1].Value = decodedValue;

That fixed the problem for me. Of course, you need to 'import System.Web;' and add the needed reference.


Kind regards,
tom
Left by Tom Zirnsack on May 06, 2014 11:44 PM

# re: Improved SSO Configuration Data Store Tool
Requesting Gravatar...
Hi again,

I am sorry, in my last post it should read 'HTML encode/decode' instead of 'HTTP'.

Regards,
tom
Left by Tom Zirnsack on May 06, 2014 11:57 PM

Your comment:
 (will show your gravatar)
 


Copyright © Paul Petrov | Powered by: GeeksWithBlogs.net | Join free