Using ADAL libraries in Dynamics 365 (Online) plugins throws exception RRS feed

  • Question

  • We are trying to get our plugin to authenticate to Azure AD using ADAL. We IL merged the assemblies into the plugin and registered it. When CRM tries to login, we get this exception:

    Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

    I am exploring alternate option shown in http://www.zacrmguy.com/alternative-to-azure-authentication-with-adal-in-dynamics-crm-online-sandbox/ but I would really like to know if the ADAL libraries are supported from CRM online instance.

    I am not sure if this is supported or if we are doing something wrong.

    Rahul Ranjit

    Thursday, November 17, 2016 3:39 PM

All replies

  • I think you are using old version of dll of CRM. Download latest sdk and use that dll

    Regards Faisal

    Wednesday, November 23, 2016 1:23 PM
  • Unless I am missing something, I don't think that's the reason. This has to do with the permissions in the CRM online Sandbox.

    Really appreciate it if you can elaborate on your answer.

    Rahul Ranjit

    Wednesday, November 23, 2016 3:32 PM
  • I might be wrong which mostly I am.

    If you suspect it is a permission issue then try with administrator privileges.

    The Microsoft.Xrm.Sdk.dll should be ver 8 plus. If you have merged an older version of dll then you can think replacing it.

    Regards Faisal

    Wednesday, November 23, 2016 4:49 PM
  • It looks like you're trying to use a function in the ADAL library that wouldn't be supported in CRM Online. The CRM Online sandbox applies code access security to limit what a plugin can do, and the exception indicates that the code is trying to do something that the sandbox does not permit

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Wednesday, November 23, 2016 4:53 PM