Answered by:
Connecting Office 365 Sharepoint Online from a CRM Online plugin

Question
-
Hello all,
I have a problem logging in to the Office 365 Sharepoint Online from CRM Online.
I have found usefull classes like MsOnlineClaimsHelper that logs in a user to Sharepoint Online as described in this post http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspxMy plugin works fine in an Onpremise environment but when uploading the plugin to my CRM Online environment, i get the following message:
$exception {"The WSHttpBinding with name WSHttpBinding failed validation because it contains a BindingElement with type System.ServiceModel.Channels.TransportSecurityBindingElement which is not supported in partial trust. Consider disabling the message security and reliable session options, using BasicHttpBinding, or hosting your application in a full-trust environment."} System.Exception {System.InvalidOperationException}
I found that changing the web.config could solve this issue but as you know, this is not possible on the cloud ?
Do you have any idea ?
Thanks
Fab
Monday, June 4, 2012 12:35 PM
Answers
-
Hello,
Unfortunately plugins which work in CRM Online are limited in their functionality and namespaces and assemblies that can be used. To work with external webservices you will have to use HttpRequest/HttpResponse - http://technet.microsoft.com/en-us/library/gg509030
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
- Proposed as answer by Andrii ButenkoMVP, Moderator Tuesday, June 5, 2012 2:02 PM
- Marked as answer by Fabson69 Wednesday, June 6, 2012 11:41 AM
Monday, June 4, 2012 9:22 PMModerator
All replies
-
Hello,
Unfortunately plugins which work in CRM Online are limited in their functionality and namespaces and assemblies that can be used. To work with external webservices you will have to use HttpRequest/HttpResponse - http://technet.microsoft.com/en-us/library/gg509030
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
- Proposed as answer by Andrii ButenkoMVP, Moderator Tuesday, June 5, 2012 2:02 PM
- Marked as answer by Fabson69 Wednesday, June 6, 2012 11:41 AM
Monday, June 4, 2012 9:22 PMModerator -
Hello Andrii,
I used 3 others assemblies in my project Microsoft.IdentityModel.dll, Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll and I merge them with IlMerge before registering my plugin. This work perfectly but the problem comes when doing the authentication on Sharepoint Online and I face this problem only when I am on CRM Online, there is no problem on my local server. Is there a way to configure binding to basicHttpBinding on CRM Online ?
Fab
- Edited by Fabson69 Tuesday, June 5, 2012 12:50 PM
Tuesday, June 5, 2012 9:26 AM -
Hello,
I'm afraid that you would not be able to work with external webservices because in On-Line your plugin registered in sandbox mode and this means that possibilities of your code are limited.
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
- Proposed as answer by Andrii ButenkoMVP, Moderator Tuesday, June 5, 2012 2:02 PM
Tuesday, June 5, 2012 10:46 AMModerator -
Ok Andrii, thank you for your support !
It makes sense now. It is not possible to query external webservices while working in sandbox mode. This mode is very restricted :-(
Regards.
Fab
Tuesday, June 5, 2012 1:50 PM -
Fabson,
Are you sure that your own answers helped you and not mine? :)
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)
Tuesday, June 5, 2012 8:04 PMModerator -
Andrii,
It's yours actualy.
Sorry, I am new on this forum.
Regards
Fab
Wednesday, June 6, 2012 11:43 AM -
Hello,
Could you please elaborate a bit on your reply? As far as I understand you are able to access external web services even in a Sandboxed plugin (according to the SDK). What makes accessing SharePoint Online specific so that it does not work in partial trust?
Thank you in advance.
----- Allan Varcoe, Cinteros AB, Stockholm, Sweden http://www.cinteros.se MCT, MBSP, MCTS, etc.
Monday, June 11, 2012 7:25 PM