从Python api访问SSO下的sharepoint [英] Accessing sharepoint under SSO from Python api

查看:81
本文介绍了从Python api访问SSO下的sharepoint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想使用SharePoint API访问我公司的SharePoint文件信息,但问题是我从网页,验证通过我的公司单点登录进行,但由于我必须通过api访问信息。我不知道
如何做到这一点。



这是我到目前为止所尝试的内容。


#https://pypi.python.org/pypi/sharepoint


来自sharepoint import SharePointSite,basic_auth_opener



server_url =" https://sharepoint.mycompanyname.com/"

site_url = server_url +" some / internal / url"



opener = basic_auth_opener(server_url," myname@mycompanydomain.net"," mycompanyssopassword")< br $>


site = SharePointSite(site_url,opener)

打印网站

for site.lists中的sp_list:

  &NBSP; print sp_list.id,sp_list.meta ['Title']




但这总是说禁止403



请告诉我如何使用我的网络凭据访问它们


解决方案

您好,


请确保该帐户有权访问SharePoint网站,请尝试使用管理员用户进行测试。


或尝试使用HTTBBasicAuth。


http://tech.bool.se/using-python-to-request-data-from-sharepoint-via-rest/


或尝试使用HttpNtlmAuth。


http://stackoverflow.com/questions/20945822/how-to-access-a-sharepoint-site-via- the-rest-api-in-python


最好的问候,


Dennis


Hi ,

I want to access my company SharePoint files information using SharePoint api but the problem is when I login from web page, validation happens through my  company Single sign on but since I have to access the information through api .I don't know how to do that.

Here is what I have tried so far.

#https://pypi.python.org/pypi/sharepoint

from sharepoint import SharePointSite, basic_auth_opener

server_url = "https://sharepoint.mycompanyname.com/"
site_url = server_url + "some/internal/url"

opener = basic_auth_opener(server_url, "myname@mycompanydomain.net", "mycompanyssopassword")

site = SharePointSite(site_url, opener)
print site
for sp_list in site.lists:
    print sp_list.id, sp_list.meta['Title']

But this always says forbidden 403

Please let me know how can I access them by using my network credentials 

解决方案

Hi,

Please make sure the account have permission to access SharePoint site, try to use an admin user to test it.

Or try to use HTTBBasicAuth.

http://tech.bool.se/using-python-to-request-data-from-sharepoint-via-rest/

Or try to use HttpNtlmAuth.

http://stackoverflow.com/questions/20945822/how-to-access-a-sharepoint-site-via-the-rest-api-in-python

Best Regards,

Dennis


这篇关于从Python api访问SSO下的sharepoint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆