How to fix AADSTS50169 error when accessing ACS from SharePoint 2013

Irek Singer 0 Reputation points
2024-07-18T17:13:16.63+00:00

I followed these instructions:

https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/use-an-office-365-sharepoint-site-to-authorize-provider-hosted-add-ins-on-an-on

but when I try to add a new Add-in app in SharePoint I get this error in ULS:

Application Authentication        aiv3i      High      An exception occurred during OAuth2 request to https://accounts.accesscontrol.windows.net/c0e654c4-1cf5-4bff-9b82-f6bfd63621ce/tokens/OAuth/2. Response: '{"error":"invalid_request","error_description":"AADSTS50169: The realm '7d681bd1-ba79-444c-8fc4-4311aeff36b4' is not a configured realm of the current service namespace. Trace ID: 3217f461-f197-4a81-a392-2c845e9f4600 Correlation ID: 8d893da1-e2cc-c0d3-5983-1f6a37b3911b Timestamp: 2024-07-18 15:18:10Z","error_codes":[50169],"timestamp":"2024-07-18 15:18:10Z","trace_id":"3217f461-f197-4a81-a392-2c845e9f4600","correlation_id":"8d893da1-e2cc-c0d3-5983-1f6a37b3911b"}'.  Exception Details: System.Net.WebException: The remote server returned an error: (400) Bad Request.     at System.Net.HttpWebRequest.GetResponse()     at Microsoft.SharePoint.I...   8d893da1-e2cc-c0d3-5983-1f6a37b3911b

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,247 questions
0 comments No comments
{count} votes