Tuesday, October 14, 2008

Enable international characters in OpenID domain names

If you're using DotNetOpenId, you should consider enabling .NET to use IDN, or the International Domain Name scheme to enable users with international characters in the host name of their OpenID to log into your site.  Enabling IDN support requires .NET 3.5. 

First, add this to your web.config or machine.config file's <configuration><configSections> area.

<section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

Then within the <configuration> tag of your web.config file, add this snippet:

<uri>
	<idn enabled="All" />
	<iriParsing enabled="true" />
</uri>

And that's all there is to it.  Your dotnetopenid web site will automatically start supporting OpenIDs from around the world.

In DotNetOpenId 2.5.1 and later, these snippets will be included in the sample sites included in the distribution.

For more information, see read the section entitled "International Resource Identifier Support" in the MSDN Magazine article Get Connected With The .NET Framework 3.5

No comments:

Post a Comment