-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error SoapFaultDetails message: '401 Unauthorized', #415
Comments
Microsoft no longer allows to use basic auth. some way to extend it for some time. |
Thanks @gautamsi , |
you have to use microsoft guide to get the oauth refresh and access token then pass access token to this library. |
Hi Everyone, Please find the solution we used to fix the same problem. The solution consist of 3 parts:
|
Part 1:
|
Part 2 - get accessToken by using userName + userPassword to email box: import * as path from 'path'; public async getEmailAccessToken(
|
Part 3 - connect to emailbox: public async connectAndChangeAllEmailsFromBlaBla(
|
Have a good day. |
Hi,
I have used this package for a while and everything has been working perfectly.
Until now.
With exactly the same setup I nowadays get the response:
Error SoapFaultDetails {
message: '401 Unauthorized',
InnerException: null,
faultCode: null,
faultString: null,
faultActor: null,
responseCode: 127,
errorCode: 0,
exceptionType: null,
lineNumber: 0,
positionWithinLine: 0,
errorDetails: DictionaryWithStringKey {
keys: [],
keysToObjs: {},
objects: {},
keyPicker: [Function (anonymous)]
},
HttpStatusCode: 401,
Exception: ServiceRequestUnauthorizedException {
message: '401 Unauthorized',
InnerException: null
}
}
Here is my setup:
const EXCHANGE_URL = 'https://outlook.office365.com/EWS/Exchange.asmx';
const ewsLogin = config.exchange.login;
const ewsPassword = config.exchange.password;
const service = new ews.ExchangeService(ews.ExchangeVersion.Exchange2013);
service.Credentials = new ews.WebCredentials(ewsLogin, ewsPassword);
service.TraceEnabled = true;
service.TraceFlags = ews.TraceFlags.All;
const email = new ews.EmailMessage(service);
email.ToRecipients.Add('[email protected]');
email.Subject = 'xxx';
email.Body = new ews.MessageBody('xxxx');
email.Body.BodyType = ews.BodyType.Text;
email.Send()
.then((val) => {
console.log("Sent");
})
.catch((e) => {
console.log("Error ", e);
});
Please help me :P
The text was updated successfully, but these errors were encountered: