小编lil*_*amp的帖子

IdentityServer4 - 卡在连接/授权/回调?client_id=

我已经成功地从本地主机中的服务器获取声明和访问令牌,但是当我将相同的代码移动到使用 SSL 的生产时,它似乎卡在连接/授权/回调?client_id=,它应该重定向到我的 www .something.com.my/Secure 页面,但是它似乎在登录 Google 后停留在连接/授权

这是我的配置

public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc();

        services.AddIdentityServer()
            //.AddDeveloperSigningCredential()
            .AddInMemoryClients(ConfigureIdentityServer.GetClients())
            .AddInMemoryIdentityResources(ConfigureIdentityServer.GetIdentityResources())
            .AddProfileService<UserProfileService>();

        services.AddSingleton<IUserStore, UserStore>();

        services.AddTransient<IPersistedGrantStore, PersistedGrantStore>();

        //Added for custom claims
        services.AddTransient<IProfileService, UserProfileService>();

        services.AddAuthentication()
            .AddGoogle("Google", options =>
            {
                options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
                //Dev and Prod share same keys
                options.ClientId = "xxx.apps.googleusercontent.com";
                options.ClientSecret = "xxx";

                options.Scope.Add("https://www.googleapis.com/auth/plus.me");
                //options.Scope.Add("https://www.googleapis.com/auth/userinfo.profile");

            })
            .AddFacebook("Facebook", options =>
            {
                options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
                //Dev
                //options.ClientId = "xxx";
                //options.ClientSecret = "xxx";

                //Prod
                options.ClientId = "xxx";
                options.ClientSecret = "xxx";


            });
    }

    public void Configure(IApplicationBuilder app, …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc oauth-2.0 identityserver4

5
推荐指数
0
解决办法
4129
查看次数

标签 统计

asp.net-mvc ×1

c# ×1

identityserver4 ×1

oauth-2.0 ×1