Trying to port a Windows .NET Standard to .NET Core 6.0 using Blazor Server. I've got the old application running just fine and I'm able to get the initial Authorization Code. Trying to pass that along with the key and secret, etc... and I get:
OAuth2Exception: invalid_grant
Dropbox.Api.DropboxOAuth2Helper.ProcessCodeFlowAsync(string code, string appKey, string appSecret, string redirectUri, HttpClient client, string codeVerifier)
docket2022.Pages.AuthDbxToken.ProcessDropboxCallback(string AuthCode) in AuthDbxToken.razor
I've made sure all the variables are passing by checking a console....
Uri uri = new Uri(NavManager.Uri);
Console.WriteLine("URI Absolute: " + uri.AbsoluteUri);
Console.WriteLine("AuthCode: " + AuthCode);
Console.WriteLine("ApiKeyString: " + ApiKeyString);
Console.WriteLine("ApiSecretString: " + ApiSecretString);
Console.WriteLine("Return URL: " + theState);
State.dbxToken = "Auth Code: " + AuthCode.ToString();
Console.WriteLine("-------------------------DropboxOAuth2Helper AuthDbxToken.razor--------------------");
OAuth2Response response = await DropboxOAuth2Helper.ProcessCodeFlowAsync(AuthCode, ApiKeyString, ApiSecretString, theState, null, null);
Of course I added a localhost redirect URI for my new project. What is strange is that scope, keys, secrets, etc.... is the same but the .NET Core version keeps getting this error. I've looked everywhere but I can't see up or down if there has been success or failure with .NET Core 6.0.