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, ...
Suggested Answer

API Integration with D365FO: Can I Get Access Token with MFA enabled on ADFS?

(1) ShareShare
ReportReport
Posted on by 1,038
Hi dears !
I have a .NET application that is integrated with D365FO through SOAP/REST APIs.
I was able to successfully integrate with D365 FO on-prem no problem through a REST getToken API with ADFS.
But there is one environment that I'm unable to integrate with, recieving /invalid_grant/ error from the getToken API.
This environment has MFA (Multi-Factor Authentication) enabled on their ADFS. I asked them to disable MFA to test the API and it worked.
Is it possible to get the access token with MFA enabled? or the only solution is to exclude the integration user from the MFA policy?
 
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
 
Any advice is appreciated !
Thanks in advance !
I have the same question (0)
  • Suggested answer
    Kevin Xia Profile Picture
    Microsoft Employee on at
    Hi,
    Can you share a screenshot of the error or the full error message? You can think about excluding specific integration users from the MFA policy first and then look for other solutions, or you can consider using the OAuth 2.0 authorization code flow. You can refer to this blog: https://impulztech.com/dynamics-365-finance-and-operations-acquire-access-token-using-oauth-2-0/This blog discusses how to obtain access token in Dynamics 365 Finance and Operations to enable data access of another application via APIs that use OAuth 2.0 authorization protocol.
    Best regards,
    Kevin
  • Momochi Profile Picture
    1,038 on at
     
    Here is the screenshot for the error I receive in the get token API in postman while MFA is enabled:
    And once we disable MFA, the access token is received without any issue.
    I thought of excluding the integration users from MFA policy, but the IT team are being strict and asking me if there are other solutions... 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 577 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 309

#3
Diego Mancassola Profile Picture

Diego Mancassola 259

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans