Tag: identityserver4

缓存在Identity Server 4中似乎不起作用

我正在尝试使用缓存方法为我们的IS4实现添加缓存。 但是,我的实现似乎没有对登录速度或每次登录访问我的数据库的查询数量产生任何影响(我希望缓存可以减少这两者)。 我为实现缓存所做的更改如下: 在Startup.cs ConfigureServices中添加了以下内容 更新了services.AddIdenttiyServer()调用以包含以下行: .AddInMemoryCaching() .AddClientStoreCache() .AddResourceStoreCache() .AddCorsPolicyCache(); 更新了ConfigureServices以使其具有以下内容: services.AddScoped(); services.AddScoped(); services.AddScoped(); 这似乎是我需要实现的唯一事情,当应用程序正常运行时,缓存似乎没有做任何事情。 我错过了什么?

身份validation限制扩展标头大小

我有一个连接到身份服务器4身份服务器的Asp .net mvc应用程序。 当我发布应用程序时,我对此错误感到不满。 上游从上游读取响应头时发送了太大的头 在上游读取响应头时,我跟踪到这个上游发送了太大的头 我无法改变配置,系统管理员已声明我们需要缩小标头。 看了之后我就不得不同意这些标题有点广泛。 应用程序中的Startup.cs services.AddAuthentication(options => { options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme; }) .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme) .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options => { options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.Authority = Configuration[“ServiceSettings:IdentityServerEndpoint”]; options.RequireHttpsMetadata = true; options.ClientId = Configuration[“ServiceSettings:ClientId”]; options.ClientSecret = Configuration[“ServiceSettings:secret”]; options.Scope.Add(“testapi”); options.ResponseType = “code id_token”; options.SaveTokens = true; options.GetClaimsFromUserInfoEndpoint = true; options.Events = new OpenIdConnectEvents() { […]

身份服务器4令牌未在使用Identity Server 3的.NetFramework Api中validation

在我的身份服务器应用程序中使用idsv4并在端口“5000”上运行有一个客户端 new Client { ClientId = “client”, // no interactive user, use the clientid/secret for authentication AllowedGrantTypes = GrantTypes.ClientCredentials, // secret for authentication ClientSecrets = { new Secret(“secret”.Sha256()) }, // scopes that client has access to AllowedScopes = { “api1” } }` 在我的.Net Framework Api的启动类中使用端口号“7001”: app.UseIdentityServerBearerTokenAuthentication( new IdentityServerBearerTokenAuthenticationOptions { Authority = “http://localhost:5000”, ValidationMode = ValidationMode.ValidationEndpoint, […]

如何在.NET 4.6上使用.NET Core的IdentityServer4?

我一直在尝试遵循IdentityServer4的启动指南。 我很高兴我的身份validation服务是一个.net核心应用程序,但我想要validation的服务是无聊的普通ASP.NET WebApi 2项目。 因此, 文档中显示的设置将不起作用。 没有IApplicationBuilder, app.UseIdentityServerAuthentication不是这里的东西。 我没有使用最新最好的MVC。 是否有任何将Identity Server 4与旧应用程序混合的文档? 是否支持?

为什么最终用户必须注销两次?

我试图让IdentityServer4在新的.NET Core 2.1应用程序中运行(它在.NET Core 2.0应用程序中完美运行)。 我尝试过以下方法: 1)下载此项目,即IdentityServer4应用程序: https : //github.com/ghstahl/IdentityServer4-Asp.Net-2.1-Identity-Examples/tree/e0aeeff7e078aa082c8e16029dd2c220acc77d7b 2)使用Identity Server4应用程序下载此项目,即MVC应用程序: https : //github.com/IdentityServer/IdentityServer4.Samples/tree/dev/Quickstarts/6_AspNetIdentity/src/MvcClient 。 3)将两个项目添加到同一解决方案中。 MVC项目使用IdentityServer项目进行身份validation; 授权等 我不得不做出以下改变: 1)更改为IdentityServer应用程序中包含的Startup(AddIdentityServer现在接受参数): services.AddIdentityServer(options => { options.UserInteraction.LoginUrl = “/Identity/Account/Login”; options.UserInteraction.LogoutUrl = “/Identity/Account/Logout”; }) 2)配置IdentityServer应用程序以侦听端口5000并在身份服务器上禁用SSL。 除了注销工具外,一切都按预期开箱即用。 当我在MVC应用程序中单击注销时; 在MVC应用程序中调用以下代码: public async Task Logout() { await HttpContext.SignOutAsync(“Cookies”); await HttpContext.SignOutAsync(“oidc”); } 然后,用户将重定向到IdentityServer应用程序中的Logout.cshtml。 但是,他们必须再次单击注销(在IdentityServer应用程序上)才能实际注销,即他们在MVC应用程序中单击注销(第二点),然后在IdentityServer中注销(第一点)。 为什么最终用户必须注销两次?

带有EF6的IdentityServer4

我已经基于此实现了IdentityServer4的基本Web API保护。 该演示基于内存数据。 大多数教程都基于用户数据的EF Core实现。 在我搜索时, IdentityServer3有一个IUserService ,现在在版本4中丢失了。 builder.AddInMemoryClients(Clients.Get()); builder.AddInMemoryScopes(Scopes.Get()); builder.AddInMemoryUsers(Users.Get()); 如何从EF6商店检索我的用户数据?

是否可以使用在.net核心上运行的Identity Server 4和在.net 4.5.1上运行的WebApi应用程序?

请考虑以下情形。 您有一个使用asp.net webapi实现api的应用程序。 您正在设置新的Identity Server 4以与基础结构一起使用。 您需要api才能使用Identity Server。 如果是IdentityServer 3,则使用IdentityServer3.AccessTokenValidation 。 如果您的api在.net核心上,您将使用IdentityServer4.AccessTokenValidation 但鉴于你的api使用旧式的asp.net webapi,甚至不是owin,而你的Identity Server基于.net核心,你有没有选择让它们一起工作?

具有Active Directory on Premise的IdentityServer 4

我们的客户端有很多应用程序,他们希望将它集成到只登录一次(单点登录),但是他们希望在内部使用活动目录,他们有自己的服务器。 我们决定评估identityserver,所以我们发现这个https://identityserver4.readthedocs.io/en/release/topics/windows.html,identitserver 4支持活动目录,但在这里我们看不到我们要把LPAD放在哪里//。 ..连接到活动目录的路由…所以我们怀疑如果identityserver支持或不支持Active目录或者我们不能很好地承担它。 谢谢。

Swashbuckle.AspNetCore v1.0.0 with OAuth2,flow:application – > IdentityServer4

我似乎无法使我的.net核心Web API与swashbuckle,OAuth2一起使用应用程序流。 当我单击“授权”按钮时,Fiddler显示调用正常,我的本地IdentityServer(4)回复了access_token。 这一切都很棒,但我不认为Swagger选择了这一点,没有任何事情发生,我不能在没有获得401的情况下触发我的控制器方法。我看不到任何cookies,没有。 我敢肯定我错过了一些超级微不足道的东西。 有人可以帮我吗? 相关代码: 在Startup.cs中配置服务 c.AddSecurityDefinition(“oauth2”, new OAuth2Scheme { Type = “oauth2”, Flow = “application”, TokenUrl = “http://localhost:61798/connect/token”, Scopes = new Dictionary { { “readAccess”, “Access read operations” }, { “writeAccess”, “Access write operations” } } }); 在Startup.cs中配置 app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions { Authority = “http://localhost:61798”, RequireHttpsMetadata = false, ApiName = “api1”, AutomaticAuthenticate = […]

Identityserver 4和Azure AD

我正在研究使用Identity Server 4在基于C#的MVC应用程序中进行身份validation。 我想使用存储在Azure AD中的帐户作为有效用户的来源,但文档似乎只是指Google和OpenID,并且仅提及Azure。 有没有人知道如何在与Identity Server 4一起使用Azure AD的过程中使用Azure AD的任何好的文档和/或教程?