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
    Manmohan Kapoor Profile Picture
    on at
    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 - MVP Profile Picture
    30,188 Moderator 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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans