OWA Web Part with single sign-on

Office SharePoint Server 2007 (aka MOSS2007), like SharePoint Portal Server 2003 before it, offers a built-in Web Part for integration with Outlook Web Access (aka OWA). Unfortunately, this Web Part has a number of limitations:

  • It needs to be configured manually by the user in order to specify the OWA URL as well as the Inbox name
  • It requires Windows Integrated Authentification for single sign-on (SSO) between SharePoint and OWA; this is fine in Intranet environments, but less practical in Extranet scenarios, where you will probably be using Forms or even Basic authentication

There are already some good posts on the subject, for example this post on Renaud Comte's blog

For a recent project, I have written a couple of Web Parts that try to solve this problem. The approach I have used is a bit devious: both Web Parts will simulate an actual OWA login (in an IFrame) by filling in an HTML form replicating all the input fields of the original OWA login form; the form is automatically submitted using JavaScript, and the user is automatically signed in to OWA.

The first Web Part will use the credentials from the HTTP Basic authentication headers.

The second Web Part leverages MOSS' SSO service. It requires that you already have configured the SSO service, with a service name of "OWA" (but you can easily change that in the source code).

Beware: both Web Parts will currently transmit the credentials to the IFrame in the clear, in the URL (as GET parameters).

The attached ZIP file contains the Visual Studio 2005 project.

You will find in the root directory two HTML files containing the OWA login forms, that are used by the Web Parts as the target of the IFrame. You should copy the appropriate file (either OWARedirect_2003.htm or OWARedirect_2007.htm) to your SharePoint's "layouts" directory, and rename the file to OWARedirect.htm. Don't forget to point the target for the form to your own OWA URL!

This is obviously a hack, but here's hoping it will help somebody one day :-)

Published 17 January 07 11:30 by tconte
Filed under:

Attachment(s): OWASSOWebPart.zip

Comments

# trankien said on September 12, 2008 4:52 AM:

Hi Thomas,

I tried to apply your code, but I received an exception at "strSSOLogonFormUrl = SingleSignonLocator.GetCredentialEntryUrl("OWA");". I guest, I didnot config "OWA" SSO service. Could you please tell me how to config it?

Thanks,

Tkien.

# Hafandi said on June 29, 2009 11:59 AM:

Hi,

can you please help me. I downloaded the code and extracted it to "layout" directory, renamed the OWA2007 file, and change the target to my exchange 2007 server. I also enabled the SSO on the server and complete the configuration of it and created application named OWA.

what should i do now? I added a page to sharepoint site with name OWA, but I don't know what to do next? is this page should be webpart page or redirect page? and what settings should I make to it?

thanks for the useful article, it was very helpful.

Anonymous comments are disabled
Page view tracker