SharePoint Online Add-in throwing AADSTS50011

Luis Lerones 5 Reputation points
2024-02-12T21:58:15.5166667+00:00

I have a couple of Sharepoint Add-in (Sharepoint hosted) that have been working perfectly till 2 days ago! Now return the following error: I get the following message: AADSTS50011: The redirect URI 'https://[mycompanyname].sharepoint.com/_forms/default.aspx' specified in the request does not match the redirect URIs configured for the application '00000003-0000-0ff1-ce00-000000000000'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. As this is a Sharepoint Add-in I can't see any on azure, and I haven't made any changes. I found that some people have this error and it was resolved on the 28-29 Jan 2024, but I am still facing the issue, and the clients are not happy.

Microsoft 365 and Office | SharePoint | Development
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,476 Reputation points Microsoft External Staff
    2024-03-05T01:34:21.84+00:00

    Hi @Luis Lerones,

    I'm glad to hear you solve the problem ,if you have any issue about SharePoint, you are welcome to raise a ticket in this forum.

    By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others." and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:

    [SharePoint Online Add-in throwing AADSTS50011]

    Issue Symptom:

    Sharepoint Add-in return error message: The redirect URI 'https://[mycompanyname].sharepoint.com/_forms/default.aspx' specified in the request does not match the redirect URIs configured for the application '00000003-0000-0ff1-ce00-000000000000'.

    Solution:

    Use the following powershell script to fix the issue

    Connect-AzureAD
    $sharePointOnlineServicePrincipal = Get-AzureADServicePrincipal -Filter "appId eq '00000003-0000-0ff1-ce00-000000000000'"
    $sharePointOnlineServicePrincipal.ReplyUrls.Add("https://.sharepoint.com/_forms/");
    Set-AzureADServicePrincipal -ObjectId $sharePointOnlineServicePrincipal.ObjectId -ReplyUrls $sharePointOnlineServicePrincipal.ReplyUrls
    

    You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks for your understanding!

    2 people found this answer helpful.

  2. RaytheonXie_MSFT 40,476 Reputation points Microsoft External Staff
    2024-02-13T03:13:52.4633333+00:00

    Hi @Luis Lerones, Check for the Authentication request in the address bar of the Microsoft login page. See if that redirect_uri matches with the reply_uri/redirect url in Azure AD (Sign into portal.azure.com => Navigate to Azure Active Directory in the left side bar > App registrations > Your app > Authentication > Redirect URIs.). Try to check the redirect uri where you configured in your Web api (ex: App settings.json or in conrollers or views) Here is the document for this issue, please make a reference https://learn.microsoft.com/en-us/troubleshoot/azure/active-directory/error-code-aadsts50011-redirect-uri-mismatch

    ---If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Stefan k 6 Reputation points
    2024-03-04T09:04:23.5066667+00:00

    This is still an issue. We experience this issue only on updated and new Add-ins. Older add-ins are still fine for now.

    Has anyone has a solution?


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.