【发布时间】:2015-10-15 03:01:11
【问题描述】:
我需要从 Mule 读取和写入 SharePoint 列表。
设置如下:Mule 3.6、SharePoint online 2013 和本地 ADFS。
对 SharePoint 的 Web 访问有效,用户通过以下 URL 序列:
- 我打开保存的 SharePoint 网站页面 --
https://[company].sharepoint.com/sites/.../Collab/... - 我得到自动重定向到
https://login.microsoftonline.com/login.srf?... - 在我输入电子邮件后,我会自动重定向到“组织的登录页面” --
https://adfs.[company].com/adfs/ls/?... - 我在那里输入电子邮件和密码,然后自动重定向回
login.microsoftonline.com,然后最终重定向到[company].sharepoint.com,在那里我可以看到列表。
在 Mule 中,我在“声明连接”模式下使用 SharePoint 2013 连接器。
配置如下:
<sharepoint:claims-connection-config
disableCnCheck="true"
name="Microsoft_SharePoint_2013__Claims_Connection"
username="[user email]"
password="[password]"
siteUrl="https://[company].sharepoint.com/sites/[site]/"
stsUrl="https://adfs.[company].com/adfs/services/trust/13/usernamemixed"
scope="urn:federation:MicrosoftOnline"
doc:name="Microsoft SharePoint 2013: Claims Connection"
/>
参数“scope”是从adfs.[company].com/adfs/ls/?... URL的参数wtrealm中找到的。
我正在尝试执行的操作如下:
<sharepoint:list-get
config-ref="Microsoft_SharePoint_2013__Claims_Connection"
doc:name="Microsoft SharePoint 2013"
listId="F93EF42E-1FAF-4CB3-8D7F-EBFC76CBDB3C"
/>
列表id是从网上找到的,用户可以访问该列表。
在单击“测试连接”和运行流程时,我都遇到以下异常:
org.mule.api.ConnectionException: Code: 403 Message: {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}}}
at org.mule.module.sharepoint.connection.BaseSharepointConnectionStrategy.connect(BaseSharepointConnectionStrategy.java:83) ~[?:?]
at org.mule.module.sharepoint.connectivity.ClaimsConnectionStrategySharepointConnectorAdapter.connect(ClaimsConnectionStrategySharepointConnectorAdapter.java:21) ~[?:?]
at org.mule.module.sharepoint.connectivity.ClaimsConnectionStrategySharepointConnectorAdapter.connect(ClaimsConnectionStrategySharepointConnectorAdapter.java:9) ~[?:?]
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementConnectorFactory.makeObject(ConnectionManagementConnectorFactory.java:47) ~[?:?]
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementConnectorFactory.makeObject(ConnectionManagementConnectorFactory.java:15) ~[?:?]
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220) ~[commons-pool-1.6.jar:1.6]
at org.mule.module.sharepoint.connectivity.SharepointConnectorClaimsConnectionConfigConnectionManagementConnectionManager.acquireConnection(SharepointConnectorClaimsConnectionConfigConnectionManagementConnectionManager.java:269) ~[?:?]
at org.mule.module.sharepoint.connectivity.SharepointConnectorClaimsConnectionConfigConnectionManagementConnectionManager.acquireConnection(SharepointConnectorClaimsConnectionConfigConnectionManagementConnectionManager.java:58) ~[?:?]
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementProcessInterceptor.execute(ConnectionManagementProcessInterceptor.java:47) ~[?:?]
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementProcessInterceptor.execute(ConnectionManagementProcessInterceptor.java:19) ~[?:?]
at org.mule.security.oauth.process.RetryProcessInterceptor.execute(RetryProcessInterceptor.java:84) ~[mule-module-devkit-support-3.6.0.jar:3.6.0]
at org.mule.devkit.3.6.1.shade.connection.management.ConnectionManagementProcessTemplate.execute(ConnectionManagementProcessTemplate.java:33) ~[?:?]
...
调查表明,此异常实际上并不是 Mule 从 SharePoint 收到的第一个错误。
在连接到https://adfs.[company].com/adfs/services/trust/13/usernamemixed/ 并获得令牌后,Mule 对https://[company].sharepoint.com/sites/.../_trust/ 执行 POST。该 URL 以 HTTP 200 OK 回答,但 HTML 包含“抱歉,出现问题”和“发生意外错误”消息。
不知道为什么,可能是因为代码 200,Mule 忽略了这一点,继续向 https://[company].sharepoint.com/sites/.../_api/web/id 发出 GET 请求,返回上面提到的 403 异常。
非常感谢您对此连接过程进行故障排除的任何帮助。
【问题讨论】:
-
只是为了不让这个简单地打开。连接器文档对此非常困惑。一方面,它在常见问题部分中说明了以下内容:“对于 SharePoint Online,支持使用标准 SharePoint Online 用户凭据进行身份验证”。另一方面,在“身份验证”部分,它提到 “基于声明的身份验证” 用于 “Microsoft SharePoint 在线身份验证”。但最后我认为 SharePoint Online 不支持本地声明身份验证。如果有人有不同的信息,请分享。
标签: sharepoint mule