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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

"Invalid_grant" Error for get Token API to ADFS on an On-Prem D365 FO

(0) ShareShare
ReportReport
Posted on by 1,054
Hi dear community!
 
We have a .NET web application that is integrated with D365 FO.
on Cloud D365 FO, there are no issues, the integration is working fine.
But on-prem D365, we are facing a /get token/ issue, saying /invalid_grant/.
The Get token API is giving back the following error:
 
in the get token API call, we are providing the following parameters:
- resource= https://url.example/namespaces/AXSF
- client_id= 111-1111-111-111 (example)
- client_secret=1111111111 (example)
- Tenant = https://url.example/adfs
- grant_type = client_credentials
 
What am I missing here?
 
Although, it has worked on another on-prem environment , but for this on-prem environment specifically, I'm encountering this issue.
 
Any advice is appreciated !
Thanks in advance !
  • Hana Xue Profile Picture
    Microsoft Employee on at
    Hi,
    This error is mentioned in the link below and check if it helps.
    ADFS - Access token request with a certificate (Client credentials grant flow) - Microsoft Q&A
    Best Regards,
    Hana
  • Momochi Profile Picture
    1,054 on at
    Hi dear Hana Xue,
     
    Thanks for sharing the link but the error mentioned in the link you provided says "invalid_client" while my error says "invalid_grant".
     
    Appreciate your help !
     
  • CU27040901-3 Profile Picture
    2 on at
    Have you resolved the problem?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 543 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 415 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 188

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans