What type of account are you authenticating with?
Main Topics
Browse All TopicsI am trying to access an exchange server using PHP to manage contacts and appointments between a web application and the exchange sever, both are on my LAN and not in the public domain. So far with little success.
I have tried the scripts at:-
http://www.troywolf.com/ar
and
http://social.technet.micr
but I always come up against an authentication error. I would be very grateful if someone could help me resolve this as I'm held up on completing the larger task until I crack it.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Not quite sure what you are asking here. The account is an exchange account for a test AD user "Robin-Tester" in the domain. I have confirmed that I can authenticate using OWA with both Firefox and IE. I have tried with various combinations such as "Robin-Tester", "Robin-Tester@domain" and "domain\Robin-Tester".
Slightly offtopic, as this is not a PHP solution:
In a recent project we used an ASP.Net proxy script that used the EWS Managed API from microsoft that wraps the webservices that Outlook web access uses to access Exchange. The proxy just converts REST calls to API calls and works like a charm in reading and writing to calendars from PHP.
Thinking outside the box, older versions of Mac Entourage (Microsoft product) I've worked with connect through WebDav too & they require case-sensitivity for the domain and username as well as the password (of course). Your "domain\Robin-Tester" is correct format, but is it case-sensitive matching the domain name as presented at the top of the Active Directory Users and Computers tree?
Depending upon what you want to do, you could use the Outlook Redemption DLL (http://www.dimastr.com/re
Essentially Outlook Redemption is an interface to allow you to talk to Exchange Server, just like MS Outlook does, but without the security block that various service packs have put in place.
Whilst the examples on the site are NOT in PHP, because it is a COM interface, it is extremely portable.
RQuadling I have no experience using PHPs COM interface. I could have a go but I'm not sure that Outlook Redemption is the way forward. Not understanding the context in which it would be used can you help me by answering this question.
Exchange sits on server1 php would be running on server2, can PHPs COM interface allow me to interface with Exchange using Outlook Redemption?
I have tried to search the Outlook Redemption yahoo group but yahoo has mucked up the group search facility.
Yes it was. Those examples look like they will work. If the server is using forms based authentication, I don't think they will. I wasn't able to test any of them yet to check for certain.
FBA requires that you query /exchweb/bin/auth/owaauth.
http://stackoverfl
Look at the top rated answer for the code I'm mentioning.
The way Redemption works is by utilising a windows mail profile.
So, if Outlook can talk to exchange (a good test), then PHP + COM + Outlook Redemption can also.
Outlook needs to be installed on the same server as PHP and Redemption.
Here is a daft example with my output.
Contacts
Contacts
Global Address List
All Address Lists
All Contacts
All Groups
All Rooms
All Users
OK. Not much. But using a TypeLibrary browser, you can see the entire list of facilities with all the parameters and return types.
This was run on a Windows XP SP3 workstation with Outlook 2003 SP3 installed (but not loaded!!!). The Exchange server is a VM running on Windows 2008 in an Sun ESX box somewhere.
darkstar3d thanks for the link. I'm going to look it over now I understand the constraints you are under so I will be patient!!. I am grateful for all the help being offered to me. One thought occurs to me. FBA is turned on in exchange but I haven't configured for HTTPS as this is exclusively for internal use and I was reluctant to spend money on a certificate for internal purpose only. Could this be the problem. I have amended the scripts I am trying so they use HTTP not HTTPS but is there a problem with this I'm not appreciating?
Darkstar3d, when I enable Forms Based Authentication in Exchange the following message comes up:-
"Forms Based Authentication requires clients to use a SSL connection. If SSL encryption is not off-loaded to another source, complete the following steps:
-Configure SSL
-Restart the IIS service"
Presumably from what you say above I can ignore this and FBA will be enabled but for HTTP not HTTPS?
If you had to enable it, it wasn't enabled already. It is not necessary, just more secure and with the results you were getting I was thinking FBA was the cause of it. It is more secure, but if this is internal only, create a self signed certificate. A local certificate authority could also be used.
Well FBA was enabled from the original install of exchange. I have tried removing it to see if that was the issue and this came up when I tried to add it again. Not entirely sure what you mean here. Are you saying:-
1. It will work without enabling SSL on IIS
or
2. I need to enable SSL on IIS for it to work and can just use a self signed certificate.
Currently none of the scripts I try work with or without it. I'm grasping at straws I think.
As far as I can see WEBDAV is enabled (see the attached jpegs). Given that I have tried a number of different scripts some using cURL some using Troy Wolf's HTTP class I can't help thinking that this is to do with exchange. One option to progress this is, if you are up for it, to set up a remote session for you to directly look at the config. That's within the rules of EEX as long as I commit to writing up the solution afterwards. I fully understand if this is not acceptable to you as your support to me is only voluntary.
Remote session currently impossible for me as I only have my corporate laptop with me.
For examples, I always look to see what Glen Scales has first! :) http://gsexdev.blogspot.co
The script at http://msdn.microsoft.com/
I should have more time over the next few days to play with this. I haven't examined those classes that Troy built fully, although from his page it seems some peeps got it to work. But, auth errors and XML errors is what I get from it. The big issue could be that PHP has moved along since then. PHP4 was everywhere then and PHP5 changed a lot of stuff. Definitely broke a lot of my scripts.
Hmmm, which version of PHP are you using?
NTLM (NT Lan Manager) is a session based security authentication mechanism for use with AD. The .NET protocols have built in routines to get through all the challenges/responses needed to authenticate.
Basic authentication is sending information (user name/password) in the clear.
From your Exchange system manager, bring up the props on the Exchange virtual server, then Access tab, Authentication button. Which methods are checked?
Yes our usual access for exchange is using outlook and it uses our AD authentication. I'm having difficulty following:-
"... Exchange system manager, bring up the props on the Exchange virtual server, then Access tab, Authentication button ...". I have tried most of the objects in exchange system manager and none of them throw up properties with an access tab.
There are two servers that pertain to what I am doing at the moment. The Domain Controller is also the exchange server running Exchange 2003 Standard. That is using Windows 2003 standard and the web server running Windows 2003 Web Edition with IIS and PHP Version 5.2.5. I use PhpEd for development on a Windows XP machine that is part of the domain and that uses PHP Version 5.2.11. The screen shot is taken from running System Manager on the domain controller.
I am puzzled as to why nothing seems to work, especially as there appears to be references to getting PHP and Exchange talking on the web. Obviously Troy got it working. I wonder if PHP5 breaks it, the original development was in 2006 so it could have been done in 4? I'll look into setting up a machine with 4 on it to see.
This may be what you need.
http://www.likewise.c
I have now returned to this. To briefly recap what has happened so far.
Originally FBA was enabled on exchange and I tried both the new HTTP class of Troy's to no avail.
I then switched off FBA and tried the old HTTP class to no avail.
I then re-enabled FBA.
I decided to start over.
I tried the old and new HTTP class and they failed.
I switched to PHP 4 and suddenly the old HTTP class worked - there were some errors being returned in PHP 5 which needed sorting out but once these were done I got the output.
In PHP 4 and 5 the new HTTP class still fails. It returns an authentication error. Using Firebug and Firecookie while I step through the code there I can't see the cookies "sessionid" and "cadata" being created.
The puzzle is that exchange is still showing FBA is switched on. If FBA is switched on is it still possible to use Basic Authentication (if that is the right term) or is FBA really off even though is shows on?
Is the failure related to something wrong with the configuration of FBA or that the cookies aren't being set?
I don't have PHP4 but I had suspected that PHP5 was the culprit after looking through the class. FBA requires the cookie being sent with every request and I didn't see a mechanism for accomplishing that (although it has been weeks since I looked at the class.)
Did you see any cookies in the response from exchange? Where are seeing that FBA is still on?
FBA shows on as in the screen shot above:-
http://www.experts-exchang
Regarding the cookies I'm not absolutely sure what I'm looking for. I have implemented Firebug and Firecookie in FireFox. Using those no cookies are being set except PHPSESSID.
Hmm I rebooted the exchange server and magically it is now working perfectly. I'm guessing that the problem was originally to do with the errors produced by PHP 5. Messing about with the FBA setting produced a overlay problem which was resolved by the reboot. MANY MANY thanks for al the help on this you are a star. Now to start exploring Webdav in anger. No doubt I shall be revisiting EEX.
This was a time consuming issue and the solution isn't easy to pinpoint so the points have been attached to a fairly arbitrary response. Without the tenacity and support of darkstar3d I doubt I would have resolved it. I haven't catalogued the changes that are needed to Troy's script. If in the future anyone wants then then message me and I will write them up.
Business Accounts
Answer for Membership
by: cescentmanPosted on 2009-09-23 at 07:45:01ID: 25403666
I have just come across another reference to this:-
e.com/Web_ Developmen t/ Web_Lang uages-Stan dards/XML/ Q_23370733 .html
http://www.experts-exchang
Again I get
"HTTP/1.1 401 Unauthorized
Error: Access is Denied."