Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AADSTS50011 error after login #13

Open
saf-itpro opened this issue Jun 26, 2020 · 0 comments
Open

AADSTS50011 error after login #13

saf-itpro opened this issue Jun 26, 2020 · 0 comments

Comments

@saf-itpro
Copy link

saf-itpro commented Jun 26, 2020

On VS2019, when using this OneDrive sample with UWP from Microsoft, I am getting the following error.

AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: '55dbdbc9-xxxxxxxxxxxxx-a24'

I have followed the sample's instructions for Registering and Configuring the app where Redirect URI I have selected is Public client (mobile & desktop), and have set it's value to https://login.microsoftonline.com/common/oauth2/nativeclient

Remarks: An online search shows some relevant links (such as this or this or this) but their context are different (as they are using web apps or Python etc.):

UPDATE:

Error occurs at line FolderLoaded?.Invoke(this, EventArgs.Empty); of the method shown below. This is line 180 of file OneDriveList.xaml.cs in the sample. And it is not the error OperationCanceledException since error goes to the second catch statement.

private async Task LoadFolderAsync(string id = null)
{
    // Cancel any previous operation
    _cancellationTokenSource?.Cancel();
    _cancellationTokenSource = new CancellationTokenSource();

    // Check if session is set
    if (AuthenticationService == null) throw new InvalidOperationException($"No {nameof(AuthenticationService)} has been specified");

    // Keep a local copy of the token because the source can change while executing this function
    var token = _cancellationTokenSource.Token;

    // Add an option to the REST API in order to get thumbnails for each file
    // https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_list_thumbnails
    var options = new[]
    {
        new QueryOption("$expand", "thumbnails"),
    };

    // Create the graph request builder for the drive
    IDriveRequestBuilder driveRequest = AuthenticationService.GraphClient.Me.Drive;

    // If folder id is null, the request refers to the root folder
    IDriveItemRequestBuilder driveItemsRequest;
    if (id == null)
    {
        driveItemsRequest = driveRequest.Root;
    }
    else
    {
        driveItemsRequest = driveRequest.Items[id];
    }

    // Raise the loading event
    FolderLoading?.Invoke(this, EventArgs.Empty);
    try
    {
        try
        {
            // Make a API request loading 50 items per time
            var page = await driveItemsRequest.Children.Request(options).Top(50).GetAsync(token);
            token.ThrowIfCancellationRequested();

            // Load each page
            await LoadGridItemsAsync(page, token);
            token.ThrowIfCancellationRequested();
        }
        finally
        {
            // Raise the loaded event
            FolderLoaded?.Invoke(this, EventArgs.Empty);
        }
    }
    catch (OperationCanceledException)
    { }
    catch (Exception ex)
    {
        // Raise the error event
        LoadingError?.Invoke(this, ex);
    }
}

Question: What I may be doing wrong, and how can we resolve the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant