Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Plugin synchrone issue system security

(0) ShareShare
ReportReport
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 ? 

  • 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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans