1

I need to read and write SharePoint lists from Mule.

Setup is the following: Mule 3.6, SharePoint online 2013 with on-premises ADFS.

Web access to SharePoint works, with user going through the following URLs sequence:

  • I open the saved SharePoint site page -- https://[company].sharepoint.com/sites/.../Collab/...
  • I get automatic redirect to https://login.microsoftonline.com/login.srf?...
  • after I type in the email, I get automatic redirect to "organization's sign-in page" -- https://adfs.[company].com/adfs/ls/?...
  • I type in email and password there and get automatically redirected back to login.microsoftonline.com, then finally to [company].sharepoint.com, where I'm able to see the lists.

In Mule, I'm using the SharePoint 2013 connector in "Claims Connection" mode.

Configuration is as follows:

<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"
/>

Parameter "scope" was found out from adfs.[company].com/adfs/ls/?... URL's parameter wtrealm.

Operation that I'm trying to perform is the following:

<sharepoint:list-get
  config-ref="Microsoft_SharePoint_2013__Claims_Connection"
  doc:name="Microsoft SharePoint 2013"
  listId="F93EF42E-1FAF-4CB3-8D7F-EBFC76CBDB3C"
/>

List id is found out from web, user has access to that list.

Both when clicking "Test connection" and when running the flow I'm getting the following exception:

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) ~[?:?]
    ...

Investigation has shown that this exception isn't actually the first error Mule gets from SharePoint.

After connecting to https://adfs.[company].com/adfs/services/trust/13/usernamemixed/ and obtaining the token, Mule performs POST to https://[company].sharepoint.com/sites/.../_trust/. That URL answers with HTTP 200 OK, but with HTML containing "Sorry, something went wrong" and "An unexpected error has occurred" messages.

Don't know why, maybe because of the code 200, Mule ignores this and proceeds to making a GET request to https://[company].sharepoint.com/sites/.../_api/web/id, which returns the 403 exception mentioned above.

Any help with troubleshooting this connection process would be very much appreciated.

1
  • Just to not leave this simply open. Connector documentation is quite confusing regarding this. On one hand, it says the following in FAQ section: "For SharePoint Online, authentication using standard SharePoint online user credentials is supported". On the other hand, in section Authentication it mentions "Claims-based authentication" for "Microsoft SharePoint authentication online". But in the end I think that on-premises Claims authentication is not supported for SharePoint online. If somebody has different information, please share.
    – Anton K
    Jul 7, 2015 at 7:26

1 Answer 1

0

The newest Microsoft SharePoint 2013 connector, version 2.1.8 released 2015-10-06, is finally able to connect to SharePoint Online with users from a on-prem AD FS.

Personally, I used the "Online" configuration type. Not sure about claim-type auth.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.