Azure AD Authentication

Santhi Dhanuskodi 325 Reputation points
2023-08-22T15:54:44.2133333+00:00

I am writing a graphql api which uses azure DB(Azure AD authentication).

my connection string is "TestDB": "Server=servername;Initial Catalog=DBName;User id = my ad acccount Persist Security Info=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication=Active Directory Integrated;",

API is failing to authenticate the user. It gives an error "Failed to authenticate the user "myaccount" in Active Directory (Authentication=ActiveDirectoryIntegrated).\r\nError code 0xwstrust_endpoint_not_found\r\nWS-Trust endpoint not found in metadata document. "

If I chnage from 'active directory integrated' to 'active directory interactive' , it is working fine. It orompts to login to AD and api returns results.

Please help to fix this.

Developer technologies .NET Entity Framework Core
Developer technologies ASP.NET ASP.NET Core
Microsoft Security Microsoft Entra Microsoft Entra ID
{count} votes

3 answers

Sort by: Most helpful
  1. Fabio Andrade 1,665 Reputation points Microsoft Employee Moderator
    2023-08-23T18:16:55.81+00:00

    Hi @Santhi Dhanuskodi

    Do you know if you are using ADFS or any other user Federation solution?

    Azure SQL blog forum has a suggested solution for the very similar error you are getting with the Integrated Authentication:

    https://techcommunity.microsoft.com/t5/azure-sql-blog/troubleshooting-problems-related-to-azure-ad-authentication-with/ba-p/1062991

    User's image

    There's also a sample DOTNet app that you could configure on Azure AD side in order to test if Integrated Authentication is working properly:

    https://learn.microsoft.com/en-us/samples/azure-samples/active-directory-dotnet-iwa-v2/active-directory-dotnet-iwa-v2/

    0 comments No comments

  2. Fabio Andrade 1,665 Reputation points Microsoft Employee Moderator
    2023-09-08T21:46:31.5133333+00:00

    @Santhi Dhanuskodi

    I wanted to check in and see if you had any other questions or if you were able to resolve this issue?

    If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.


    If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.

    0 comments No comments

  3. Fabio Andrade 1,665 Reputation points Microsoft Employee Moderator
    2023-09-14T22:02:25.7133333+00:00

    @Santhi Dhanuskodi

    I wanted to check in and see if you had any other questions or if you were able to resolve this issue?

    If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.


    If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.