Comments (16)
Investigating further on the 'CreateItem' request sent, I could find some differences in the headers:
- The C# working version has no "Authoriszation: ' Basic ..." header (and the Node one has one), and no 'Accept' nor 'Accept-Encoding' headers
- The C# working version also has much more headers:
HTTP/1.1 200 OK
Cache-Control: private
Transfer-Encoding: chunked
Vary: Accept-Encoding
Server: Microsoft-IIS/10.0
request-id: 783e106b-af4a-4b4b-807e-d25aa6dca657
X-CalculatedBETarget: dag3ex1.indiv4.local
Strict-Transport-Security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains
X-DiagInfo: DAG3EX1
X-BEServer: DAG3EX1
X-AspNet-Version: 4.0.30319
Set-Cookie: exchangecookie=42xxx; expires=Tue, 02-Jan-2024 10:29:08 GMT; path=/; HttpOnly, X-BackEndCookie=S-1-5-21-1840533827-1334025008-xxx-90715=xxx/N0s/Oq87Pxc3Gxc/HgZaRm5aJy9GTkJyek4HP; expires=Wed, 01-Feb-2023 10:29:08 GMT; path=/ews; secure; HttpOnly
Persistent-Auth: true
X-Powered-By: ASP.NET
X-FEServer: CAS7
Date: Mon, 02 Jan 2023 10:29:08 GMT
Content-Encoding: gzip
Any clue to make my Node app work?
Many thanks!
from ews-javascript-api.
Am I the only one have this issue? If anyone has any clue, even if it's not a solution, I would greatly appreciate any feedback: it might help me to find what to look after, to fix it.
Big thank you in advance!
from ews-javascript-api.
Same problem here, but no solution yet...
from ews-javascript-api.
Thanks Cimchd, I feel less alone.
from ews-javascript-api.
Have you tried to find out if you need NTLM auth or basic auth? Check with your exchange admin. This library does not have built in Windows NTLM auth you have to use it separately
from ews-javascript-api.
Thank you Gautamsi, the C# code above works. Could it work if NTLM is required?
from ews-javascript-api.
yes, c# runs on windows and it can choose between NTLM or not, but you have to know beforehand with this lib and use https://github.com/ewsjs/xhr to setup NTLM.
from ews-javascript-api.
Thank you so much, will give a try (I have zero skills on ntlm, hope I won't be stuck due to this)
from ews-javascript-api.
Great news, thanks to the xhr package I could make it work, thank you again!
Now, I would like to use the autodiscover, but it does not work:
const ews = require("ews-javascript-api")
var ewsAuth = require("ews-javascript-api-auth");
ews.ConfigurationApi.ConfigureXHR(new ewsAuth.ntlmAuthXhrApi(user.email, user.password));
var autod = new ews.AutodiscoverService(new ews.Uri("https://autodiscovers.outlook.com/autodiscover/autodiscover.xml"), ews.ExchangeVersion.Exchange2010_SP1);
autod.Credentials = new ews.WebCredentials(user.email, user.password);
var settings = [
ews.UserSettingName.InternalEwsUrl,
ews.UserSettingName.ExternalEwsUrl,
ews.UserSettingName.UserDisplayName,
ews.UserSettingName.UserDN,
ews.UserSettingName.EwsPartnerUrl,
ews.UserSettingName.DocumentSharingLocations,
ews.UserSettingName.MailboxDN,
ews.UserSettingName.ActiveDirectoryServer,
ews.UserSettingName.CasVersion,
ews.UserSettingName.ExternalWebClientUrls,
ews.UserSettingName.ExternalImap4Connections,
ews.UserSettingName.AlternateMailboxes
];
autod.GetUserSettings([user.email], settings)
.then(function (response) {
//do what you want with user settings
}, function (e) {
console.error("autod error", e)
});
}
When I run this, I get: autod error undefined
I have tried some variants, but no luck. Do you know what is wrong here?
Many thanks
from ews-javascript-api.
Softly asking again in case my last question was skipped :) Many thanks again for the help provided already!
from ews-javascript-api.
Autodiscover may not work with NTLM, in case you are using NTLM you can provide direct URL to ews.
in this example, you have already provided url so it is not going to autodiscover anything
from ews-javascript-api.
Thank you very much Gautamsi! Do you refer to the code example I gave on February 3rd? The only URL it provides is one for autodiscovery (autodiscovers.outlook.com/...
), so I don't understand why you say it is not going to autodiscover anything.
Regarding NTLM, autodiscovery works with the C# code I have provided on January 2nd, so I suspect the reason of failure is not NTLM, do you agree? Or do you mean that the autodiscover implementation of the ews-javascript-api node package does not work with NTLM?
One more hint: I have tried with a 3rd party tool (Calendly) that by giving only the email address and the password, it was able to connect to that specific account, so the autodiscovery has worked in that case too.
Many thanks in advance for any further help! I would love so much to offer autodiscovery in my app :)
from ews-javascript-api.
I no longer have access to NTLM exchange server to test this :(
from ews-javascript-api.
Hi @gautamsi, I'm experiencing the same issue as @bfredo123.
I no longer have access to NTLM exchange server to test this :(
I've setup a test Exchange server following these instructions. Is there anything that the instructions are missing to enable NTLM?
https://learn.microsoft.com/en-us/exchange/plan-and-deploy/deploy-new-installations/create-azure-test-environments?view=exchserver-2019
from ews-javascript-api.
That should do it, let me know how can I access this. you can connect with me on linkedin (link in profile) to send message with credential.
from ews-javascript-api.
thanks @joeauyeung for the server access,
I have updated version to 0.14
(ccd9d30) which fixes this. The fix is sourced from SamDecrock/node-http-ntlm#107
alternative solution was to use NODE_OPTIONS=--openssl-legacy-provider
or the option in the node command line.
from ews-javascript-api.
Related Issues (20)
- Authorisation problem - 401 HOT 6
- Error SoapFaultDetails message: '401 Unauthorized', HOT 8
- TypeScript errors when compiling (cannot find name PrivilegedUserId and more) HOT 4
- Usage React Native
- Failing to fetch .msg file attachment from ews exchange server ews-javascript-api HOT 4
- Booking type causes sync to fail
- Specify certificate authority while sending request HOT 2
- nodejs 18: digital envelope routines::unsupported HOT 5
- Appointment.Bind sometimes return null Organizer HOT 2
- Possibility to set User-Agent HOT 4
- when creating an event in the calendar, the body is not added HOT 1
- UNABLE_TO_VERIFY_LEAF_SIGNATURE HOT 1
- Missing typescript declaration for CreateItem HOT 2
- how to retrieve strings from Extended Properties with more than 255 characters HOT 1
- Missing finally in promise declaration
- AWS WorkMail: 500 Error HOT 1
- Question: Can we create a new mailbox for an existing AD user using this library? HOT 3
- Cannot get attachment of .EML type HOT 1
- Appointment created by ews-javascript-api are shown in Monrovia timezone HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ews-javascript-api.