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
401 - 503 from outlook.office365.com #113
Comments
Mention it's an awesome framework, worked with servers located in-house, before we moved to outlook365 |
Strange, was that the full stacktrace? If I remember correctly, From what I've seen, Office365 requires you to auth with your email address, but it looks like you're doing that already. We don't handle |
Thanks for the fast reply!
|
Regarding the loop, set |
hm, so you're saying we could set is_service_account=False, it will bypass the loop and able to access the mailbox? Normally it's not a service account, i do access a "shared mailbox", but currently I use my account, don't have access to a "service account" account yet.. |
"Service account" is just a confusing name for enabling exponential backoff on connection errors in exchangelib. It's purely an exchangelib thing, it has no relation to anything in EWS. |
Just some ideas for debugging: I would put exchangelib aside for a moment and check if you can authenticate using just By the headers, it looks like OAuth authentication is also supported by the server. We don't implement that yet, but you may have luck authenticating with that instead. I believe some "corporate" Office365 setups will redirect you to some on-site SSO portal for the login process. Maybe that's what's biting you. |
Solved it using https://account.activedirectory.windowsazure.com . It generates a random password for android/iphone apps in case we need the mail on cellphone. |
Can't authenticate on outlook.office365.com apparently, and it looks like it's because of the realm?
Not sure, but i think we need to use realm when authing? Is there a way to enforce it ?
THanks!
DEBUG:exchangelib.protocol:Waiting for _protocol_cache_lock
DEBUG:exchangelib.protocol:Protocol call cache miss. Adding key '('https://outlook.office365.com/EWS/Exchange.asmx', Credentials('xx.xx@on.nokia.com', '********'), False)'
DEBUG:exchangelib.transport:Getting service auth type for https://outlook.office365.com/EWS/Exchange.asmx
DEBUG:exchangelib.transport:Requesting b'<s:Envelope xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.mi
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): outlook.office365.com
DEBUG:requests.packages.urllib3.connectionpool:https://outlook.office365.com:443 "POST /EWS/Exchange.asmx HTTP/1.1" 401 0
DEBUG:exchangelib.transport:Request headers: {'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'python-requests/2.13.0', 'Content-Length': '448', 'Accept': '/', 'Content-Type': 'text/xml; charset=utf-8', 'Connection': 'keep-alive'}
DEBUG:exchangelib.transport:Response headers: {'Content-Length': '0', 'X-Powered-By': 'ASP.NET', 'WWW-Authenticate': 'Basic Realm=""', 'Server': 'Microsoft-IIS/8.5', 'Date': 'Thu, 06 Apr 2017 12:00:07 GMT', 'X-FEServer': 'MWHPR14CA0055', 'r
DEBUG:exchangelib.transport:realm:
DEBUG:exchangelib.transport:Auth type is basic
DEBUG:exchangelib.transport:Getting docs auth type for https://outlook.office365.com/EWS/types.xsd
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): outlook.office365.com
DEBUG:requests.packages.urllib3.connectionpool:https://outlook.office365.com:443 "GET /EWS/types.xsd HTTP/1.1" 401 0
DEBUG:exchangelib.transport:Request headers: {'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'python-requests/2.13.0', 'Accept': '/', 'Content-Type': 'text/xml; charset=utf-8', 'Connection': 'keep-alive'}
DEBUG:exchangelib.transport:Response headers: {'X-Powered-By': 'ASP.NET', 'WWW-Authenticate': 'Basic Realm=""', 'Server': 'Microsoft-IIS/8.5', 'X-WSSecurity-Enabled': 'True', 'X-FEServer': 'MWHPR14CA0066', 'Content-Length': '0', 'X-Federati
DEBUG:exchangelib.transport:realm:
DEBUG:exchangelib.transport:Auth type is basic
DEBUG:exchangelib.protocol:Server outlook.office365.com: Created session 24317
DEBUG:exchangelib.protocol:Server outlook.office365.com: Created session 9073
DEBUG:exchangelib.protocol:Server outlook.office365.com: Created session 31633
DEBUG:exchangelib.protocol:Server outlook.office365.com: Created session 14394
DEBUG:exchangelib.version:Asking server for version info
DEBUG:exchangelib.version:Getting https://outlook.office365.com/EWS/types.xsd with auth type HTTPBasicAuth
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): outlook.office365.com
DEBUG:requests.packages.urllib3.connectionpool:https://outlook.office365.com:443 "GET /EWS/types.xsd HTTP/1.1" 503 0
DEBUG:exchangelib.version:Request headers: {'Accept-Encoding': 'gzip, deflate', 'Authorization': 'Basic c29tZXBhc3M===', 'User-Agent': 'python-requests/2.13.0', 'Accept': '/', 'Connection': 'keep-alive'}
DEBUG:exchangelib.version:Response code: 503
DEBUG:exchangelib.version:Response headers: {'X-BEServer': 'VI1PR0701MB2319', 'Retry-After': '30', 'Content-Length': '0', 'X-BackEndHttpStatus': '503', 'Server': 'Microsoft-IIS/8.5', 'X-FEServer': 'MWHPR14CA0055', 'X-DiagInfo': 'VI1PR0701MB
DEBUG:exchangelib.version:Service is unavailable. Unable to get version info from docs
DEBUG:exchangelib.version:Shortname according to https://outlook.office365.com/EWS/types.xsd: None
DEBUG:exchangelib.protocol:Server outlook.office365.com: Waiting for session
DEBUG:exchangelib.protocol:Server outlook.office365.com: Got session 14394
DEBUG:exchangelib.version:Test if service API version is Exchange2016 using auth HTTPBasicAuth
DEBUG:exchangelib.util:Session 14394 thread 12508: retry 0 timeout 120 POST'ing to https://outlook.office365.com/EWS/Exchange.asmx after 0 s wait
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): outlook.office365.com
Traceback (most recent call last):
File "C:\local\Python35-32\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 379, in _make_request
httplib_response = conn.getresponse(buffering=True)
TypeError: getresponse() got an unexpected keyword argument 'buffering'
During handling of the above exception, another exception occurred:
The text was updated successfully, but these errors were encountered: