• Sign In
 
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...

  • Advanced search options...
  • Blog Home
  • About
  • Email Blog Author
  • Share this
  • RSS for posts
  • Atom
  • RSS for comments
  • CDO (20)
  • Code Snippet (42)
  • Custom Providers (15)
  • Debugging (7)
  • DevMsgTeam (278)
  • Documentation (101)
  • DST (8)
  • EWS (7)
  • Exchange (100)
  • Gotchas (91)
  • Hotfix (28)
  • MAPI (220)
  • MAPI Download (48)
  • MFCMAPI (92)
  • MSDN (54)
  • Non Dev (11)
  • OOM (17)
  • Outlook (163)
  • Outlook 2007 Auxiliary Reference (45)
  • Outlook Integration API (11)
  • Protocol Docs (20)
  • PST/OST (22)
  • Referrals (8)
  • Vista (12)
  • WrapPST (15)
Links:
  • Download MFCMAPI
  • MFCMAPI on Facebook
  • Troubleshooting Outlook Crashes
  • Office Update Center
  • Developer Messaging Team Blog
This site is provided "AS IS" with no warranties, and confers no rights. Use of included code samples are subject to the terms specified in the Terms of Use.
Archives
  • May 2012 (1)
  • April 2012 (3)
  • March 2012 (3)
  • February 2012 (3)
  • January 2012 (1)
  • December 2011 (3)
  • November 2011 (1)
  • October 2011 (3)
  • September 2011 (1)
  • August 2011 (1)
  • July 2011 (4)
  • June 2011 (3)
  • May 2011 (3)
  • April 2011 (3)
  • March 2011 (5)
  • February 2011 (1)
  • January 2011 (2)
  • December 2010 (1)
  • November 2010 (4)
  • October 2010 (1)
  • September 2010 (3)
  • August 2010 (5)
  • July 2010 (3)
  • June 2010 (3)
  • May 2010 (1)
  • April 2010 (3)
  • March 2010 (3)
  • February 2010 (3)
  • January 2010 (2)
  • December 2009 (3)
  • November 2009 (5)
  • October 2009 (4)
  • September 2009 (5)
  • August 2009 (5)
  • July 2009 (11)
  • June 2009 (6)
  • May 2009 (5)
  • April 2009 (3)
  • March 2009 (18)
  • February 2009 (10)
  • January 2009 (3)
  • December 2008 (2)
  • November 2008 (2)
  • October 2008 (5)
  • September 2008 (4)
  • August 2008 (10)
  • July 2008 (6)
  • June 2008 (8)
  • May 2008 (2)
  • April 2008 (4)
  • March 2008 (2)
  • February 2008 (2)
  • January 2008 (5)
  • December 2007 (3)
  • November 2007 (2)
  • October 2007 (3)
  • September 2007 (1)
  • August 2007 (4)
  • July 2007 (5)
  • June 2007 (3)
  • May 2007 (4)
  • April 2007 (1)
  • March 2007 (6)
  • February 2007 (3)
  • January 2007 (2)
  • December 2006 (4)
  • November 2006 (3)
  • October 2006 (1)
  • August 2006 (1)
  • June 2006 (5)
  • May 2006 (5)
  • December 2005 (1)
  • November 2005 (4)
  • October 2005 (2)
  • September 2005 (1)
  • April 2005 (3)
  • December 2004 (2)
  • September 2004 (2)
  • August 2004 (3)
  • July 2004 (3)

Auth and Check Names

MSDN Blogs > SGriffin's MAPI Internals > Auth and Check Names

Auth and Check Names

Stephen Griffin - MSFT
11 Aug 2009 5:49 PM
  • Comments 3

When I posted the Referral Madness article, there was an intriguing comment that I didn’t get a chance to investigate until it came up in a case. The commenter noted that when we used RPC_C_AUTHN_GSS_NEGOTIATE as our authentication mechanism, we could no longer use “Check Name” in the dialog brought up by ConfigureMsgService:

Check Name dialog displayed by ConfigureMsgService

If we hit Check Name, we get an error that the name could not be resolved due to network problems:

The name could not be resolved.

To understand why we get this error, we look at one of the caveats I noted:

During profile configuration (ConfigureMsgService), the Exchange provider will do an NSPIBind to the Exchange server to lookup the mailbox name. This single bind and lookup is unavoidable.

In order to perform the name resolution involved in Check Name, the Exchange provider is going to go through DSProxy. In network terms, this means we’re sending the packets directly to the Exchange server. DSProxy picks up our packets and forwards them on, unchanged, to the GC. Consider how this affects authentication. When we use RPC_C_AUTHN_GSS_NEGOTIATE, in most environments this means we’re going to use Kerberos. Combining the two: the client thinks it needs to negotiate Kerberos authentication with the Exchange server. It begins the handshake, sending a packet with a ticket using the Service Principal Name (SPN) for the Exchange server. DSProxy grabs this packet and whips it on over to the GC. The GC tries to parse the ticket in the packet but can’t since the ticket wasn’t intended for the GC. The GC returns the Kerberos error KRB_AP_ERR_MODIFIED. This error bubbles up on the client side as MAPI_E_NETWORK_ERROR, resulting in the dialog.

This problem with proxying Kerberos packets was noted in a KB article a long time ago, which has one of the earliest references to profile settings to enable referral. In the KB article, they wanted to enable Kerberos authentication to get around a problem with authenticating local system accounts, but due to the problem discussed here, also had to enable referral.

Does this mean we’ve got a bug in DSProxy’s handling of Kerberos? Not really – DSProxy predates Windows’ adoption of Kerberos by a number of years. Kerberos authentication can by proxied, but the proxy must be aware it’s proxying Kerberos traffic – it’s not as simple as reading packets off one port and sending them out another. On the other hand, NTLM authentication, the default used by the Exchange provider when we don’t specify an authentication mechanism, can handle being passed to the GC by DSProxy. This would fall under the heading of design limitation.

So – the upshot:

  • Failure to perform Check Name in this scenario does not indicate a problem with the profile and does not indicate a problem with the network.
  • If you’ve configured a profile for referral and reconnect, using RPC_C_AUTHN_GSS_NEGOTIATE, you cannot use ConfigureMsgService to reconfigure the profile. If you really want to reconfigure the profile, build a new one instead.
  • If you want to be really clever, you could remove the auth setting before calling ConfigureMsgService, then add it back when you’re done.
  • 3 Comments
Exchange, MAPI, Gotchas, MAPI Download, DevMsgTeam, Referrals
Comments
  • pcunite
    22 Oct 2009 9:16 AM

    Is it possible to call ConfigureMsgService and have zero RPC auth attempts occur? I am trying to configure a profile and offline, disconnected from the network it works after a short timeout, but if the network connection is good and the user is not authenticated to the Exchange's domain I get a user/password prompt. I don't want to get the auth yet, just make a dummy profile.

  • Stephen Griffin - MSFT
    22 Oct 2009 10:02 AM

    Good question - I believe it's possible if you take on most of the configuration work yourself and fill in the properties manually...but I've not tried to do it myself. If you want to try it, look at the profile before and after you call ConfigureMsgService and see what properties actually get set. The trick would then be figuring out how to populate them.

  • pcunite
    22 Oct 2009 10:25 PM

    Writing my own ConfigureMsgService function which adds the MSEMS service to the registry is doable but I would rather not. :)

Page 1 of 1 (3 items)
Leave a Comment
  • Please add 3 and 4 and type the answer here:
  • Post
  • © 2012 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy Statement
  • Report Abuse
  • 5.6.402.223