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 :-)
Comments
Anonymous
September 11, 2008
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.Anonymous
June 29, 2009
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
February 18, 2012
HI, I am using SharePoint Foundation and used an iframe with its src as "http://mail.domain/owa".. i want to login into this account using windows credentials. i tried the steps mentioned by you, but i am confused where to place the "redirectowa.htm" and "*.cs" files. Should i place the complete folder into it or make a new folder?? i need to meet my deadlines and this post is my only solution, as far as i know. plz help.Anonymous
March 17, 2012
Does this work for SP2010; it retrieves the user credentails for only one user to whom the credentials is set in central admin and not any AD users? Do we need to do any other configuration other than setting up SSS in central admin ?Anonymous
May 15, 2013
and what about SharePoint 2010 please ?!!