Skip to content
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

Connect to sharepoint using auth cookies #44

Open
nebhandari opened this issue Nov 27, 2019 · 1 comment
Open

Connect to sharepoint using auth cookies #44

nebhandari opened this issue Nov 27, 2019 · 1 comment

Comments

@nebhandari
Copy link

I need to connect to sharepoint using auth cookies - rTFa and FedAuth.

Can you share the substitute command for this :
opener = basic_auth_opener(server_url, "username", "password")

@pentatoma
Copy link

pentatoma commented Dec 5, 2019

Hi nebhandari,

although i cannot help you with your problem specifically, i may provide an example on how i authenticate using NTLM auth. You may be able to modify my code to your needs and apply it to your type of authentication.
I use python3 in the following example.

# I use urllib.request for my custom opener
import urllib.request, urllib.error, urllib.parse
# I use a modified version of python-ntlm, providing me with the ability to use NTLM in py3
sys.path.append('./python-ntlm/python30/')
from ntlm import HTTPNtlmAuthHandler

passman = urllib.request.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, URL, USERNAME, PASSWORD)

auth = HTTPNtlmAuthHandler.HTTPNtlmAuthHandler(passman)
opener = urllib.request.build_opener(auth)
site = SharePointSite(URL, opener)

URL, USERNAME and PASSWORD being user-defined constants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants