Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / Plugin synchrone issue...
Sales forum
Suggested answer

Plugin synchrone issue system security

Posted on by 5

Hello 

whtin a CRM online ( sandbox) we attach a  synchrone post create plugin where we  are calling an external api using an httpclient request 

the following issue appear :

pastedimage1678461664607v1.png

any workaround please ? 

Categories:
  • Jamil Lamyae Profile Picture
    Jamil Lamyae 5 on at
    RE: Plugin synchrone issue system security

    using unit test it returns response empty respone= ""

    pastedimage1678695819077v1.png

    using the trace it doesn't return the response trace==> their is no tracing for the response 

    pastedimage1678697012957v3.png

    using the profiler it returne error system security 

    pastedimage1678696509138v2.png

    the same json and endpoint are well responding using postman 

  • PabloCRP Profile Picture
    PabloCRP 1,086 on at
    RE: Plugin synchrone issue system security

    using c# Unit test gives you a 200's status response?

    403 status code mean "I know how you are but you don't have the right access to do this" so check the api key you are passing in headers request or bearer token you are creating against your API.

  • Jamil Lamyae Profile Picture
    Jamil Lamyae 5 on at
    RE: Plugin synchrone issue system security

    thank you fo the reply

    I stop the profiling and testing using the trace and executing the request throw postman (it repond 201)

    but throw plugin still having the same issue 403 forbidden 

    pastedimage1678655333938v1.png

  • Suggested answer
    PabloCRP Profile Picture
    PabloCRP 1,086 on at
    RE: Plugin synchrone issue system security

    Hi, I assume that the image above it's run within a plugin profile, making calls to external service in plugin profile result in a System.Security.SecurityExceptions when debugging, I sugest do the following:

     - Ensure your plugin is build in .Net Framework 4.6.2 or greater 

    - Test your service but using Unit Tests, XUnit, MSTests... or using a client (Postman, Insomnia, etc) and ensure it responds correctly, the status codes will tell you.... (200,202,400,etc)

    - You could log your request using  ITracingService from plugins so you will be able to do something like "TracingService.Trace(json);" and copy the  request and use it in the step mentioned before.

    regards.

    If it was helpful please consider mark it as verified answer

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans