Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

oauth2 script to to authenticate a client

Posted on by 165

Hi ,

Iam a new bee to dynamics crm. I have created and app in Azure directory and have the clientid and secret key. I tried authentication using postman oncde the credentials are entered in the popup the screen closes automatically.

pastedimage1599735823191v1.png

pastedimage1599735884369v2.png

pastedimage1599735915555v3.png

If someone can help me to get a script which prompts a user to authenticate and create a token  and execute to request GL transcations.

Thanks,

Silvester

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: oauth2 script to to authenticate a client

    Hi,

    As per your screenshot you have WebAPIURL variable in Manage Environment. Check the value of URL and you should be able to find the CRM URL.

    It should be in below format.

    CRMORG.crm.dynamics.com

    Replace CRMORG with your CRM instance ORG and replace CRM with your instance.

    Also, make sure you have given Dynamics CRM Online permission under API Connection in Azure AD App registration.

    docs.microsoft.com/.../mt790170(v=crm.8)

    Please mark my answer verified if i were helpful

  • josephsilvester Profile Picture
    josephsilvester 165 on at
    RE: oauth2 script to to authenticate a client

    Hi Bipin,

    Could you please guide, How can I get the CRM url?

    Thanks,

    Silvester

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: oauth2 script to to authenticate a client

    HI,

    Check below screenshot from my postman request which is already working.

    2845.CQ6.PNG

    Replace Tenant ID with your Tenant ID in request URL.

    login.microsoftonline.com/{Replace with your Tenant ID}/oauth2/token

    Body - 

    Replace with your CLient ID

    Replace with your Client Secret

    Replace resource with your CRM URL

    In Authorization tab Select No auth fromd dropdown.

    Please mark my answer verified if i were helpful

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans