Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

System.AggregateException {"No auth method found"} #16

Description

@MusicalCreeper01

I'm currently adding dropbox file sharing to an application I'm working on, and I have it setup to get the auth key from the user, and then it stores the auth key in the user registry. Now I'm having issues when trying to get user profile data.

It keeps throwing "System.AggregateException" with the inner Exception of {"No auth method found"} on the line:
"var accountInfo = await client.Core.Accounts.AccountInfoAsync();"
This is the relevant piece of code:

        public static void init()
        {
            if (!RegistryManager.HasKey("DropboxAuth"))
                new DropboxAuth(); //DropboxAuth is a winform with a web brower element that the user uses to login and get their auth token
            else
            {
                authKey = RegistryManager.GetKey("DropboxAuth");
                InitClient().Wait();
            }
        }

        private static async Task InitClient()
        {
            client = new Client(DropboxAuth.options);
            var authRequestUrl = await client.Core.OAuth2.AuthorizeAsync("code");

                var token = await client.Core.OAuth2.TokenAsync(authKey);

            // Get account info -- error on this line
            var accountInfo = await client.Core.Accounts.AccountInfoAsync();

            Console.WriteLine("Uid: " + accountInfo.uid);
            Console.WriteLine("Display_name: " + accountInfo.display_name);
            Console.WriteLine("Email: " + accountInfo.email);
            initialized = true;
        }

I know that the user's auth token is being returned correctly, so I'm not sure where the auth error is coming from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions