Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to authenticate when we call a external WEBAPI from html page in web resources.

(0) ShareShare
ReportReport
Posted on by 25

I have a WEBAPI which is doing DB operations. This WEBAPI needs to be invoked from a HTML page in web resources in CRM. I am invoking the WEBAPI from HTML page using ajax. I need to do authentication for this call.

How can this be achieved?

*This post is locked for comments

  • Suggested answer
    RE: How to authenticate when we call a external WEBAPI from html page in web resources.

    Please refer the below link ..It's very good article which will help you to solve the WEBAPI problem.

    community.dynamics.com/.../ms-crm-2016-web-api-operations-retrieve-single-or-multiple-records

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: How to authenticate when we call a external WEBAPI from html page in web resources.

    You need to retrieve a token, and then add the Authorization header to your request:

    req.setRequestHeader("Authorization", "Bearer " + token);

    If you are managing the credentials yourself, you can convert your credentials to Base64 on client side and re-convert them to string on api side.

    There are other options, all based on the sensitivity of your request, and what data source you are trying to connect with.

    You tags say CRM 2011, so it doesn't seem like you are using CRM Web Api, but your own custom webapi.

    Hope this helps.

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,375 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans