Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Consume Dynamic CRM REST API from other application using OAuth Tokens

Posted on by 105

Hi All,

I am new to OAuth token Concept. So i have few queries?

1. Should i get a new "access token" for each "HTTP GET request made to the CRM REST API"?

2. What should i do with the "refresh token"?

3. Should i permanently store any of the tokens in the client application?

Thankyou

*This post is locked for comments

  • Suggested answer
    Shaminderpal Singh Profile Picture
    Shaminderpal Singh 1,565 on at
    RE: Consume Dynamic CRM REST API from other application using OAuth Tokens

    Hi Bhavik,

    Please mark the answer as verified if it worked for you.

    -shaminder

  • Suggested answer
    Shaminderpal Singh Profile Picture
    Shaminderpal Singh 1,565 on at
    RE: Consume Dynamic CRM REST API from other application using OAuth Tokens

    Hi,

    That depends on how are you implementing your application.

    If you are writing it client side where tokens would be generated in browser, implement implicit grant which gives short lived access token only

    Implementation Detail-docs.microsoft.com/.../v1-oauth2-implicit-grant-flow

    If you are implementing it in web service (passive mode interaction), then implement client credentials flow which would also generate access token only that are valid for an hour. You can cache it for an hour and then regenerate it.

    Implementation Detail-docs.microsoft.com/.../v1-oauth2-client-creds-grant-flow

    If you are implementing it in server side based application where user will be interacting and providing credentials then implement authorization code flow grant where you can make use of refresh tokens and silently acquire access tokens.

    Implementation Detail-docs.microsoft.com/.../v1-protocols-oauth-code

    -Shaminder

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans