Skip to content

Wrong redirect url #1240

Description

@ehtick

In a c# winform project i try to connect to a sharepoint site with MFA enabled.

Created the app in Entra Id and run the following code

        var autm = PnP.Framework.AuthenticationManager.CreateWithInteractiveWebBrowserLogin(
                    clientId: clientId,
                    openBrowserCallback: openBrowserCallback,
                    useWAM: false // Disable WAM to force standard browser popup
            );

using (var ctx = await autm.GetContextAsync(url))
{

  Web web = ctx.Web;
  ctx.Load(web, w => w.Title);
  ctx.ExecuteQuery();

  Console.WriteLine($"Connected to site: {web.Title}");

}

this will return an error in the browser

ADSTS50011: The redirect URI 'http://localhost:52541' specified in the request does not match the redirect URIs configured for the application 'd983d0bc-4270-40cc-b7d5-065cfe901f33'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

the returned redirect url is random, how can i get the code to use the correct redirect url?
Could not find anyway to set the redirect url.

regards

Eddy

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions