Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/322.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Instagram OAuth提供程序-身份验证问题_C#_Asp.net Core 2.0_Instagram Api - Fatal编程技术网

C# Instagram OAuth提供程序-身份验证问题

C# Instagram OAuth提供程序-身份验证问题,c#,asp.net-core-2.0,instagram-api,C#,Asp.net Core 2.0,Instagram Api,我正在尝试使用Instagram作为.Net Core 2.0应用程序中的外部登录提供商进行身份验证。 我的中间件配置如下所示: Startup.cs services.AddAuthentication().AddInstagram(options => { options.ClientId = ApplicationSettings.InstagramSettings.ApplicationId; options.ClientSecret =ApplicationSetti

我正在尝试使用Instagram作为.Net Core 2.0应用程序中的外部登录提供商进行身份验证。 我的中间件配置如下所示: Startup.cs

services.AddAuthentication().AddInstagram(options =>
{
   options.ClientId = ApplicationSettings.InstagramSettings.ApplicationId;
   options.ClientSecret =ApplicationSettings.InstagramSettings.ApplicationSecret;
   options.Scope.Add(ApplicationSettings.InstagramSettings.Permissions);
   options.SaveTokens = true; 
});
AccountController中的ExternalLogin方法保持不变:

    [HttpPost]
    [AllowAnonymous]
    [ValidateAntiForgeryToken]
    public IActionResult ExternalLogin(string provider, string returnUrl = null)
    {
        // Request a redirect to the external login provider.
        var redirectUrl = Url.Action(nameof(ExternalLoginCallback), "Account", new { returnUrl });
        var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl);

        return Challenge(properties, provider);
    }
然而,什么时候

var info = await _signInManager.GetExternalLoginInfoAsync();
在ExternalLoginCallback()中调用,结果为null

注:

  • 这对于Facebook提供商来说非常好,在中间件配置中没有其他设置
  • 如果我在Fiddler中检查网络活动,我可以看到Instagram成功地将access_令牌发送回我的应用程序,只是GetExternalLoginInfoAsync()无法读取它

有什么想法吗?

我使用的Instagram OAuth provider版本(2.0.0-rc2-final)中有一个bug,它阻止正确处理用户信息响应。 我切换到最新的RTM夜间构建包,在那里修复了bug