Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

ERROR REQUESTING Token FROM THE Authentication context - General ADAL Error

(0) ShareShare
ReportReport
Posted on by 26

We have a custom webservice we use to connect to customer's D365 for Sales in the cloud. We have one instance of the webservice for each customer. This is working for all customers but one and we are getting ERROR REQUESTING Token FROM THE Authentication context - General ADAL Error. The only thing that differs in the connection to the different customers is the connection string. The code is exactly the same for each customer. Here's the details:

  • Connection string uses OAuth with the Microsoft global APP ID and Redirect URL
  • We tested with a non-interactive and interactive account we use to login to the interface and get the same error
  • We force TLS1.2 in the code with ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
  • We checked with the customer and they do not have MFA turned on for the accounts we are using to access or any other conditional access

My hunch is that the customer has some setting in their Azure AD but i have no idea what it can be and we have no visibility of it. Is there anything else i can do/try/test?

  • Jazzy4321 Profile Picture
    Jazzy4321 26 on at
    RE: ERROR REQUESTING Token FROM THE Authentication context - General ADAL Error

    For this item:

    Make sure the customer's Dynamics 365 instance is set up correctly to allow connections from your webservice. You can check this by going to the Dynamics 365 admin center, selecting the instance, and then selecting the Instance Properties tab. Make sure the "Allow other Microsoft services to access this instance" option is enabled.

    Is the Dynamics 365 admin center PowerPlatform Admin? If so, I do not see an instance tab. If not, how do i get to the Dynamics 365 admin center?

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,274 Super User 2024 Season 1 on at
    RE: ERROR REQUESTING Token FROM THE Authentication context - General ADAL Error

    hi

    It sounds like you've done some thorough troubleshooting already, but here are a few additional things you could try:

    Check if the customer has any conditional access policies in place that might be blocking access to your webservice. You can do this by going to the Azure portal, selecting Azure Active Directory, and then selecting Conditional Access. If there are any policies set up, make sure they are not blocking access for the accounts you are using.

    Check if the customer has any firewall rules that might be blocking access to your webservice. You can ask them to check their firewall logs and see if any connections are being blocked.

    Make sure the customer's Dynamics 365 instance is set up correctly to allow connections from your webservice. You can check this by going to the Dynamics 365 admin center, selecting the instance, and then selecting the Instance Properties tab. Make sure the "Allow other Microsoft services to access this instance" option is enabled.

    Double-check the connection string you are using for the customer. Make sure all the parameters are correct and that there are no typos or errors.

    If none of these steps resolve the issue, you may need to contact Microsoft support for further assistance. They should be able to help you troubleshoot the issue and identify any potential Azure AD or Dynamics 365 configuration issues.

    Daniele

  • Vijaya.K Profile Picture
    Vijaya.K 10 on at
    RE: ERROR REQUESTING Token FROM THE Authentication context - General ADAL Error

    Thanks for the answer.

    Same connection string is working in outside VDI environment. Inside VDI client has a set up of proxy and SSO login.

    When I try to connect in VDI disabling the proxy it works. My application windows application how to by pass the proxy.

    When user clicks on CRM end point or url it will redirected to adfs using browser where as using program it says login failed in VDI.

    Something really stopping the redirect in VDI

    Note : 2FA is enabled for this app.

    Outside VDI experience is same as browser login.

    Appreciate your help.

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,274 Super User 2024 Season 1 on at
    RE: ERROR REQUESTING Token FROM THE Authentication context - General ADAL Error

    hi

    The "General ADAL Error" message usually indicates that there is an issue with the authentication process between the webservice and the Dynamics 365 instance. Here are some additional steps you can take to troubleshoot the issue:

    Check the Dynamics 365 instance's Azure Active Directory (Azure AD) settings: Ensure that the customer's Azure AD settings allow access to your application, and that the app ID and redirect URL are correctly configured. You may need to work with the customer's IT team to check and adjust these settings.

    Verify the credentials being used: Ensure that the credentials being used to authenticate to the Dynamics 365 instance are correct and have sufficient permissions. Double-check the username and password, and ensure that the account has the necessary permissions to access the required resources.

    Check the webservice code: Review the code of the webservice to ensure that it is correctly configured to authenticate to the Dynamics 365 instance. Ensure that the code is using the correct authentication method (OAuth), and that the authentication parameters are correctly configured.

    Review the error logs: Check the logs for any additional error messages or details that may provide insight into the issue. Reviewing the logs may also help to identify any specific steps that are causing the issue.

    DAniele

  • Jazzy4321 Profile Picture
    Jazzy4321 26 on at
    RE: ERROR REQUESTING Token FROM THE Authentication context - General ADAL Error

    We are not using virtual desktop in Azure. Our webservice is running on a VM in our hosted environment and that webservice works with other customers running the same version of Dynamics 365.  Anything i can try/test?

  • Vijaya.K Profile Picture
    Vijaya.K 10 on at
    RE: ERROR REQUESTING Token FROM THE Authentication context - General ADAL Error

    I have similar issue in VDI (virtual desktop in azure) environment I am not able to connect using OAuth where as same code  working non VDI.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans