Web表单c#oauth刷新令牌

Web表单c#oauth刷新令牌,c#,oauth,single-sign-on,C#,Oauth,Single Sign On,在我的webforms应用程序中,当我尝试使用OAuth2登录时,出现一个错误: AADSTS54005:OAuth2授权代码已兑换,请使用新的有效代码重试,或使用现有刷新令牌 代码如下: var idClient = ConfidentialClientApplicationBuilder.Create(clientId) .WithRedirectUri(redirectUrl) .WithTenantId(tenant)

在我的webforms应用程序中,当我尝试使用OAuth2登录时,出现一个错误:

AADSTS54005:OAuth2授权代码已兑换,请使用新的有效代码重试,或使用现有刷新令牌

代码如下:

var idClient = ConfidentialClientApplicationBuilder.Create(clientId)
            .WithRedirectUri(redirectUrl)
            .WithTenantId(tenant)
            .WithClientSecret(SecretApp)               
            .Build();

string[] scopes =  ScopesString.Split(",".ToCharArray()) ;         

var result = await idClient.AcquireTokenByAuthorizationCode(scopes, notification.Code).ExecuteAsync();
我已经搜索并尝试了在网上找到的几个示例,但我无法实现刷新令牌

是否有人有用于webforms和C的代码示例

提前谢谢