具有Asp.Net标识和外部身份验证的IdentityServer4无法注销

时间:2016-12-03 05:42:34

标签: asp.net-core-1.0 identityserver4

重现的步骤:

  1. 下载asp.net身份快速入门: https://github.com/IdentityServer/IdentityServer4.Samples/tree/dev/Quickstarts/6_AspNetIdentity
  2. 2.添加google身份验证nuget包

    1. 配置Google身份验证:
    2. 3A。在Startup.cs中,ConfigureServices方法:

      services.AddIdentity<ApplicationUser, IdentityRole>(x=> { x.Cookies.ExternalCookie.AuthenticationScheme = "Google"; })
      

      3B。在Startup.cs中,配置方法:

      app.UseIdentity();
         app.UseIdentityServer();
      
          app.UseCookieAuthentication(new CookieAuthenticationOptions
          {
              AuthenticationScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme,
              AutomaticAuthenticate = false,
              AutomaticChallenge = false
          });
      
          app.UseGoogleAuthentication(new GoogleOptions
          {
              AuthenticationScheme = "Google",
              SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme,
              ClientId = "your client id",
              ClientSecret = "your client secret"
          });
      

      启动身份服务器和mvc客户端。您应该能够使用谷歌登录并注册。单击“注销”按钮,您将收到以下错误:

      Specified method is not supported.
      at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler1.HandleSignOutAsync(SignOutContext context) at Microsoft.AspNetCore.Authentication.AuthenticationHandler1.d__63.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.AspNetCore.Http.Authentication.Internal.DefaultAuthenticationManager.d__14.MoveNext()
      

      关于什么可能出错的任何想法? Github问题在这里:https://github.com/IdentityServer/IdentityServer4/issues/530

0 个答案:

没有答案