Tuesday, June 21, 2011

Misc : Windows Live Writer

 

Something in the nature of an experiment. Setting up Windows Live Writer so I can contribute to the TechNet Wiki (my name there is nzpcmad1) so thought I would try to my actual blog.

Enjoy!

Monday, June 20, 2011

.NET : Reflector 7 won't load add-ins-

The new Reflector 7 is pretty whizzy but it generally won't load the old add-ons from here. So frustrating - all these useful tools but problems, problems ...

Mr. Google to the rescue (as always!).

You need to run the Reflector Plugin Converter.

Essentially, this converts the version number from 5.0 to 7.0.

Run in a command prompt as an administrator.


...\Reflector7>PluginConverter.exe Reflector.CodeSearch.dll 7.0.0.0

Reflector plugin converter - Sebastien LEBRETON (reflexil.net)
Backuping Reflector.CodeSearch.dll to Reflector.CodeSearch.dll.bak
Reading Reflector.CodeSearch.dll
Found version 5.0.0.0, patching to 7.0.0.0
Writing Reflector.CodeSearch.dll


Enjoy!

Friday, June 17, 2011

Visual Studio : Debgging ASP.NET appaliocation running in IIS

VS 2010 - IIS 7.5.

Normal situation for me is to run my applications inside IIS rather than inside the VS web server or IIS Express. This is mainly because of issues around https (although IIS Express does help in this regard).

The problem then is how to debug it. The way around this is to use Debug / Attach to Process.

First connect to your application from a browser.

Now go to VS, set your breakpoint and in the "Attach to Process" entry, you'll see a w3wp.exe entry. (Under the user name , you'll see that it uses the DefaultAppPool.) Click on this, ignore warnings and execute your application workflow from the browser until you hit the breakpoint.

Job done!

Note: Nearly all of my applications use the DefaultAppPool. Would it breakpoint if it used a different one?

Note: I've found that unless you run up your app in the browser first, you don't see the w3wp entry.

Enjoy!

Thursday, June 16, 2011

PowerShell : Survival Guide

Take a look at Windows PowerShell Survival Guide.

Everything you wanted to ask about PowerShell and were afraid to ask!

See the cheat sheets:

Windows PowerShell Refcard

Windows PowerShell Quick Reference: A two-page "cheat sheet."

Enjoy!

Wednesday, June 15, 2011

Misc : Help other developers out

Over the past few months, I've been far more proactive in helping other developers who have posted tools etc. on the Internet.

I've tested a new STS, a whizzy certificate tool and an utility that shows the claims that a RP gets without having to have actual RP.

Did some testing - provided feedback and comments.

I've been amazed by the response.

You get a dialogue going with other people, they give you some good hints and (in a minor sort of way) you kind of feel like you know them.

It's been really worthwhile.

So find a tool that you use, test a new release and see where you go ..

Which poses the question I often ponder - "How did developers work before the Internet? Can we actually develop without Google?"

BTW - Can you Fizz Buzz?

Enjoy!

Tuesday, June 07, 2011

SharePoint 2010 : Do you need ADFS in addition to the SP STS?

This is a question that has been puzzling me for a while. Given that SP 2010 has its own STS, what value is derived from federating the SP STS with the company ADFS and then federating this ADFS with other companies STS?

Why not simply federate the SP STS with other companies STS directly?

I looked high and low for this answer but couldn't find anything that completely answered this for me.

Then the SP chapters for the excellent Claims Based Identity & Access Control Guide were published.

(Aside: If you have any interest whatsoever in the claims world, I urge you to read this guide and look at the accompanying samples!)

This includes a diagram of the "hub model" viz:





Notice that Adatum has both a SP STS and a ADFS.

But then they show the "direct trust model" viz:





Notice that although Adatum has an ADFS, it plays no part in the federation to other companies STS.

So the answer would seem to be "No".

However, as per the guide, the advantages of the hub model are:


  • It's easier to manage multiple trust relationships in ADFS rather than SharePoint.
  • It's simpler to manage a single trust relationship in SharePoint and it avoids the requirement for multiple custom claims providers.
  • You can reuse the trust relationships in the FP with other relying parties.
  • You can leverage ADFS features such as integration with auditing tools to track token issuing.
  • ADFS supports the SAMLP protocol in addition to WS-Federation.


From my experience, the ADFS GUI is far easier to use than SP Powershell commands. The last point is potentially also a deal-breaker. It means that you can't use the SP STS directly if the other companies use non-ADFS products to do the federation e.g. PingIdentity. OpenSSO, OpenAM, Tivoli Identity Manager etc.

Enjoy!

Claims : Funny joke

Came across this on Vittorios's excellent blog.

Ref:

The gist of it is:


A passive client enters a shop, and starts looking around.

A salesperson approaches: "Sir, can I help you?"

And the passive client: "Just browsing."


OK - so you need some claims background to get it.

For those who don't have that background - there are two claims profiles for clients viz. active (web services) and passive (browsers).

Enjoy!

Friday, June 03, 2011

ADFS : Stop / start ADFS v2.0

The MMC plugin for ADFS v2.0 (Active Directory Federation Services) has no way of stopping and starting ADFS. (In that same way that IIS has Stop and Restart links).

However, there are two ways to do this.

The first is via the Services menu.

Start / Administrative Tools / Computer Management / Services and Applications / Services / AD FS 2.0 Windows Service

(Description : This enables Active Directory Federation Services 2.0 to issue security tokens and information cards.)

The second is via the command line. Ensure you are running as Administrator.


C:\Windows\system32>net stop adfssrv
The AD FS 2.0 Windows Service service is stopping.
The AD FS 2.0 Windows Service service was stopped successfully.

C:\Windows\system32>net start adfssrv
The AD FS 2.0 Windows Service service is starting........
The AD FS 2.0 Windows Service service was started successfully.


Sure beats stopping / restarting the whole Windows 2008 server!

Enjoy!

WIF : Generating self-signed certificates

If you work with WIF (Windows Identity Foundation), you'll soon find that you need lots of self-signed certificates. These are used for securing the top level SSL connection and signing and encrypting the token.

Potentially, you need three certificates. The SSL certificate is mandatory as is the token signing certificate but the token encryption certificate is optional. You could use the same certificate for all three - not that that is recommended!

In IIS 7.5, in IIS manager, click on the very top level on the LHS. In the middle pane, under IIS, click on "Server Certificates". Then in the RHS, click on "Create Self-Signed Certificate". After creating one, click on "Default Web Site" on the LHS. On the RHS, click on "Bindings" and you can associate this certificate with the HTTPS port 443 connection.

The problem with this certificate is that the cn (common name) is the machine name of your IIS server, not the URL of the web site. Also, the certificate is not added to the "Trusted Root Certificate Authorities" section of the browser certificate store. You need to do this manually. All this results in browser certificate errors.

SElfSSL7 overcomes these problems and this is the utility I generally use to resolve this. There are options to automatically add the new certificate to the certificate store and to update the IIS binding. (See a previous blog entry for more info.)

There are many other ways to create certificates e.g.:

Makecert.exe (Certificate Creation Tool)

or the

Win32 version of OpenSSL. There's a good article on how to use it here.

You can also do this in PowerShell - refer: Creating Self Signed Certificates with PowerShell.

DeployManager is a neat tool to create and display certificates (coming largely from the WCF viewpoint). Unlike the mmc snap-in which shows the Windows names (Personal), this shows the .NET names (My):

DeployManager

To look at the certificates, use:

Certutil

or OpenSSL

or the Certificate snap-in to mmc : How to: View Certificates with the MMC Snap-in. The same article also shows you how to view certificates with Internet Explorer.

The Certmgr.exe (Certificate Manager Tool) is also useful.

Enjoy!

Friday, May 20, 2011

ACS : Powershell commands with Appfabriclabs / Proxy

The ACS team have just announced a set of Powershell commands for ACS.

See here.

Two small problems - they work for ACS but not for Appfabriclabs and ,secondly, they don't work for people who have to work behind a proxy.

Some quick changes to the provided VS project should have you running in no time.

For Appfabriclabs:

In Constants.cs


//public const string AcsHostName = "accesscontrol.windows.net";
public const string AcsHostName = "accesscontrol.appfabriclabs.com";


For the proxy:

In ServiceManagementWrapper.cs - just add the proxy code below.


private string GetTokenFromACS()
{
var client = new WebClient();

WebProxy proxy = new WebProxy("1.2.3.4", 1234);

proxy.BypassProxyOnLocal = true;
proxy.UseDefaultCredentials = true;

client.Proxy = proxy;

client.BaseAddress = string.Format("https://{0}.{1}", this.serviceNamespace,
Constants.AcsHostName);

...
}


Then rerun the startHere.cmd to update and install the plugin.

Enjoy!

Wednesday, May 11, 2011

Misc : To celebrate the 250th post!

Yup, folks, this is the 250th post (on Wednesday, 11th May 2011).

The very first one was on Wednesday, March 23, 2005 entitled "SQL CE : Merge Replication". (When the world was young and I still did embedded work and Windows CE was cool bananas!).

Enjoy!

Powerpoint : Using the pen

Came across a neat trick in Powerpoint 2010.

If you hit F5 to run your presentation, you can then right-click on the slide:

Pointer Options / Pen

and then draw some annotations or arrows or whatever to help explain. You can also use this to highlight various pieces of text on the fly. Naturally, you can change the pen colour.

When you finish the deck, you will be asked if you want to keep the annotations.

However, if you start with a blank slide, you can use this to physically draw Powerpoint slides that are only pictures, arrows etc. in freehand.

Build up the blank slides, say "Yes" to keep annotations and voila - a freehand presentation.

There are keyboard shortcuts e.g. Ctrl P for the Pen, Ctrl E to Erase, Ctrl M to show / hide the markup etc.

There's a full list here.

Enjoy!