#🔒 Problem with ClientContext().with_user_credentials

47 messages · Page 1 of 1 (latest)

raw tide
#

Hello guys, can someone explain why am getting this error please, I try everything but it isn't working

calm adderBOT
#

@raw tide

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

livid citrus
raw tide
#

sure

#

wait

livid citrus
raw tide
livid citrus
#

Use a pastebin pls

raw tide
#

yes 2sec

livid citrus
raw tide
#

code is this : ```py

Authentication

ctx = ClientContext(url).with_user_credentials(username, password)
web = ctx.web.get().execute_query()

livid citrus
#

It looks worse than the screenshots

raw tide
#

wait

#
File c:\Users\ridgh\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py:467, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
    466 try:
--> 467     self._validate_conn(conn)
    468 except (SocketTimeout, BaseSSLError) as e:

File c:\Users\ridgh\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connectionpool.py:1099, in HTTPSConnectionPool._validate_conn(self, conn)
   1098 if conn.is_closed:
-> 1099     conn.connect()
   1101 # TODO revise this, see https://github.com/urllib3/urllib3/issues/2791

File c:\Users\ridgh\AppData\Local\Programs\Python\Python312\Lib\site-packages\urllib3\connection.py:653, in HTTPSConnection.connect(self)
    651 server_hostname_rm_dot = server_hostname.rstrip(".")
--> 653 sock_and_verified = _ssl_wrap_socket_and_match_hostname(
    654     sock=sock,
    655     cert_reqs=self.cert_reqs,
    656     ssl_version=self.ssl_version,
    657     ssl_minimum_version=self.ssl_minimum_version,
    658     ssl_maximum_version=self.ssl_maximum_version,
    659     ca_certs=self.ca_certs,
    660     ca_cert_dir=self.ca_cert_dir,
    661     ca_cert_data=self.ca_cert_data,
    662     cert_file=self.cert_file,
    663     key_file=self.key_file,
...
--> 114     logger.error(e.response.text)
    115     self.error = "Error: {}".format(e)
    116     raise ValueError(e.response.text)

AttributeError: 'NoneType' object has no attribute 'text'
raw tide
livid citrus
#

OK slightly better

#

How about the code?

#

Its just those 2 lines?

raw tide
livid citrus
livid citrus
raw tide
#

hmm is there a way to solve that ?

livid citrus
raw tide
#

hmm

#

I can't really give the whole code because it contains credential information

#

but from what I know, the error is in the lines given

livid citrus
raw tide
#

hmm

#

These are the important statements

livid citrus
#

ah sharepoint

raw tide
#

do you know what is the problem pleaseee

livid citrus
raw tide
#

hmm

#

nope still not working 😦

livid citrus
#

idk

#

There's a couple of Github issues of similar nature

#

The latest one doesn't seem to be answered

#

🤷‍♂️

raw tide
#

god 😦

#

anyone else that can help please... really need your help

calm adderBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.