即使注销后身份服务器3会话也始终保持不变

问题描述 投票:0回答:1

我正在使用Identity Server 3,并且具有多个angular 8应用程序作为客户端。

在客户端,我正在使用“ angular-auth-oidc-client”库来实现SSO。

我在app.module中具有以下配置。

enter image description here

BUT onCheckSessionChanged从未触发...即使从同一浏览器的其他选项卡..中注销。

enter image description here

下面是我的注销代码。

this.oidcSecurityService.logoff()

身份服务器配置:

public static void UseIdentityServerCustomStoreSetup(this IAppBuilder app)
        {
            app.Map("/Identity", idApp =>
            {

                var EventsOptions = new EventsOptions()
                {
                    RaiseErrorEvents = true,
                    RaiseFailureEvents = true,
                    RaiseInformationEvents = true,
                    RaiseSuccessEvents = true
                };


                var defaultViewServiceOptions = new DefaultViewServiceOptions();
                defaultViewServiceOptions.CacheViews = false;


                var Factory = new IdentityServerServiceFactory()
                .UseInMemoryClients(Clients.Get())
                .UseInMemoryScopes(Scopes.Get());

                Factory.UserService = new Registration<IUserService, UserManagementService>();

                Factory.ConfigureDefaultViewService(defaultViewServiceOptions);
                var cust = new CustomeValidator();
                Factory.CustomRequestValidator = new Registration<ICustomRequestValidator, CustomeValidator>();
                var option = new IdentityServerOptions()
                {
                    SiteName = "",
                    LoggingOptions = GetFullLoggingConfig(),
                    EventsOptions = EventsOptions,
                    Factory = Factory,
                    RequireSsl = false,
                    EnableWelcomePage = false,
                    SigningCertificate = LoadCertificate()
                };

                option.AuthenticationOptions = new IdentityServer3.Core.Configuration.AuthenticationOptions
                {
                    EnablePostSignOutAutoRedirect = true,
                    RequireSignOutPrompt = false,


                    CookieOptions = new IdentityServer3.Core.Configuration.CookieOptions
                    {
                        AllowRememberMe = true,
                        IsPersistent = false,
                        RememberMeDuration = TimeSpan.FromMinutes(24),

                    },
                    EnableSignOutPrompt = false
                    ,
                    PostSignOutAutoRedirectDelay = 0,
                    EnableLoginHint = true

                };

                idApp.UseIdentityServer(option);

            });

            Serilog.Log.Logger =
                new LoggerConfiguration().MinimumLevel.Debug()
                    .WriteTo.File(@"c:\logs\IdSvrAdmin-{Date}.log")
                    .CreateLogger();
            //  app.UseResourceAuthorization(new AuthorizationManager()); // for authorization
        }

Identity Server中的客户端配置

new Client
            {
                Enabled = true,
                ClientName = "UMS Client",
                ClientId = "UMSClient",
                 AccessTokenType = AccessTokenType.Reference,
                Flow = Flows.Implicit,
                ClientSecrets = new List<Secret> { new Secret { Value= "[email protected]" } },
                RequireConsent = false,
                RedirectUris = new List<string>
                {
                    Urls.LIVE_URL+"3001"
                },
                AllowedCorsOrigins = new List<string>
                {
                    Urls.LIVE_URL+"3001"
                },
                // Valid URLs after logging out
                PostLogoutRedirectUris = new List<string>
                {
                    Urls.LIVE_URL+"3001"
                },

                AllowAccessToAllScopes = true,
                AccessTokenLifetime = Clients.TimeOut
            }
angular identityserver3 angular-auth-oidc-client
1个回答
0
投票

请简明扼要,不要发布整个应用程序代码。

© www.soinside.com 2019 - 2024. All rights reserved.