We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Tech Dev Oldsmar
3 years agoHelpful | Level 6
Net Core 6.0 compatibility? Getting OAuth2Exception: invalid_grant for ProcessCodeFlowAsync...
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 a...
- 3 years ago
What does your GetAuthorizeUri call look like? Your GetAuthorizeUri configuration needs to match your ProcessCodeFlowAsync configuration. For example, if you passed a redirectUri to GetAuthorizeUri, you need to also pass that same redirectUri to ProcessCodeFlowAsync. See this sample code as an example.
You mentioned using a redirect URI, but if you're not passing it to ProcessCodeFlowAsync in this code, that could cause this error.
Greg-DB
Dropbox Staff
What does your GetAuthorizeUri call look like? Your GetAuthorizeUri configuration needs to match your ProcessCodeFlowAsync configuration. For example, if you passed a redirectUri to GetAuthorizeUri, you need to also pass that same redirectUri to ProcessCodeFlowAsync. See this sample code as an example.
You mentioned using a redirect URI, but if you're not passing it to ProcessCodeFlowAsync in this code, that could cause this error.
Tech Dev Oldsmar
3 years agoHelpful | Level 6
That was it. Thank you! For reference if anyone is doing this in Blazor-Server (code thinned out to pertinent issue):
@page "/dbxAuth"
@using System.Runtime.InteropServices
@using System.Threading.Tasks
@using Dropbox.Api
@inject NavigationManager NavManager
@code
{
public async Task ProcessDropboxCallback(string AuthCode)
{
// HERE IS WHERE I FIXED THE ISSUE
var uriBuilder = new UriBuilder(NavManager.Uri);
uriBuilder.Query = uri.Query.ToString();
uriBuilder.Fragment = null;
uriBuilder.Query = null;
OAuth2Response response = await DropboxOAuth2Helper.ProcessCodeFlowAsync(AuthCode, ApiKeyString, ApiSecretString, uriBuilder.Uri.AbsoluteUri, null, null);
}
}
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!