Connecting through a proxy
Thanks for this very interesting plugin. I faced a problem to connect to my SharePoint because my network is through a proxy. Should it be possible to use the tool behind a proxy ?
Tried this but got a Cookie problem: ctx_auth = AuthenticationContext(url) ctx_auth.acquire_token_for_user(username, password) request = ClientRequest(ctx_auth) options = RequestOptions("{0}/_api/web/".format(url)) options.set_header('Accept', 'application/json') options.set_header('Content-Type', 'application/json') options.set_header('proxies', {'http':'http://XX.XX.XX.XX:8080', 'https':'https://toto:[email protected]:8080'}) data = request.execute_query_direct(options)
Could you provide the error that you're seeing? What precisely do you mean by "Cookie problem."
This is the traceback problem :
<client.office365.runtime.utilities.request_options.RequestOptions object at 0x0000000003D0E3C8>
TypeError Traceback (most recent call last)
C:\Anaconda2\envs\dcfta\lib\site-packages\client\office365\runtime\client_request.py in execute_query_direct(self, request_options) 77 """Execute client request""" 78 print request_options ---> 79 self.context.authenticate_request(request_options) 80 if request_options.method == HttpMethod.Post: 81 from client.office365.sharepoint.client_context import ClientContext
C:\Anaconda2\envs\dcfta\lib\site-packages\client\office365\runtime\auth\authentication_context.pyc in authenticate_request(self, request_options) 18 def authenticate_request(self, request_options): 19 """Authenticate request""" ---> 20 request_options.set_header('Cookie', self.provider.get_authentication_cookie()) 21 22 def get_auth_url(self, redirect_url):
C:\Anaconda2\envs\dcfta\lib\site-packages\client\office365\runtime\auth\saml_token_provider.pyc in get_authentication_cookie(self) 63 64 logger.debug_secrets("self.FedAuth: %s\nself.rtFa: %s", self.FedAuth, self.rtFa) ---> 65 return 'FedAuth=' + self.FedAuth + '; rtFa=' + self.rtFa 66 67 def get_last_error(self):
TypeError: cannot concatenate 'str' and 'NoneType' objects
Are you working with the code from the python3-connect-rest-sample? That code doesn't include any references to the Office365 rest client, but the error message above is from the Office 365 rest client.
Let us know exactly what you're trying to accomplish, ideally including steps to reproduce the issue, and we'll try to help resolve the problem. Generally speaking, you should be able to work with the rest client through a proxy, but we'll need more information to help diagnose the issue. Thanks!