web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to Use the refresh token to obtain a new access token?

(0) ShareShare
ReportReport
Posted on by 90

We have a web app (ASP.Net) published on Azure and we connected the web app with CRM Dynamics 365 on Azure Active Directory. 

We followed this tutorial https://debajmecrm.com/2016/02/29/dynamics-crm-web-api-external-application/ and we can get the access token using the authorization code after the user authenticates, 

but we have a problem when trying to send this access token to make HttpWebRequest  to retrieve data from crm, this error appears ('AADSTS54005: OAuth2 Authorization code was already redeemed, please retry with a new valid code or use an existing refresh token.). 

After searching i found this tutorial https://community.dynamics.com/crm/b/magnetismsolutionscrmblog/posts/dynamics-365-online-authenticate-with-user-credentials it says we have to use the refresh token to obtain a new access token. 

So, How can we use the refresh token to obtain a new access token?

I have the same question (0)
  • Suggested answer
    Luis Nogueira Profile Picture
    on at

    Hi,

    To refresh the token please follow the steps on : docs.microsoft.com/.../v1-protocols-oauth-code

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans