Tag: identityserver4

2 Docker容器与Docker Compose之间的Http通信

我有两个docker容器(在Windows 10主机上的Linux容器),从微软/ aspnetcore基础图像构build。 当我单独启动它们时,两个容器都运行良好。 我正在尝试使用Docker Compose来启动两个容器(一个是使用IdentityServer的身份提供程序,另一个是由Identity Server保护的api资源)。 我有以下docker-compose.yml文件: version: '3' services: identityserver: image: eventloom/identityserver build: context: ../Eventloom.Web.IdentityProvider/Eventloom.Web.IdentityProvider dockerfile: DockerFile ports: – 8888:80 eventsite: image: eventloom/eventsite build: context: ./Eventloom.Web.Eventsite dockerfile: Dockerfile ports: – 8080:80 links: – identityserver depends_on: – identityserver environment: IdentityServer: "http://identityserver" “eventsite”容器的启动类使用IdentityModel来ping“identityserver”的发现端点。 由于某种原因,启动永远无法成功获取发现信息,即使我可以login到eventsite容器并从身份服务器获取ping响应。 还有什么我需要做的,以允许赛事通过端口80与身份服务器通信?

授权使用docker时,不能使用identityserver4

我有一个configuration为使用identityserver4的.net-core web api应用程序。 一切工作正常本地。 其中一个web api方法包含[Authorize]属性,在本地运行时可以正常工作。 但是当使用“docker”并使用带有Authentication Bearer的postman调用api方法时,我得到“500内部服务器错误”。 我在CORS的web api中有这个configuration。 services.AddCors(); app.UseCors(policy => { policy.AllowAnyHeader(); policy.AllowAnyMethod(); policy.AllowAnyOrigin(); });

在Docker容器内运行的Identity Server 4例外:无法加载DLL“System.Security.Cryptography.Native.OpenSsl”

我正在尝试使用Docker容器中的ASP.NET Core运行Identity Server 4,并且继续获取以下exception Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.TypeInitializationException: The type initializer for 'Crypto' threw an exception. —> System.DllNotFoundException: Unable to load DLL 'System.Security.Cryptography.Native.OpenSsl': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Interop.Crypto.GetMaxMdSize() at Interop.Crypto..cctor() — End of inner exception stack […]

如何从docker机器内部和外部使用IdentityServer4?

我希望能够从Docker机器的外部和内部对Identity Server (STS)进行身份validation。 我在设置容器内外的正确权限时遇到了麻烦。 如果将权限设置为内部名称mcoidentityserver:5000则该API可以进行身份​​validation,但是客户端不能获取令牌,因为客户端位于泊坞窗networking之外。 如果我将权限设置为localhost:5000那么客户端可以获得一个令牌,但是API不能识别授权名称(因为在这种情况下, localhost是主机)。 我应该怎样设置pipe理局? 或者,也许我需要调整dockernetworking? 图 红色箭头是我遇到麻烦的部分。 详情 我正在设置一个使用ASP.NET Core API(在Linux上),Identity Server 4(Linux上的ASP.NET Core)和PostgreSQL数据库的Windows 10 docker开发环境。 PostgreSQL不是一个问题,包括在图中的完整性。 它映射到9876,因为我现在还有一个PostgreSQL实例在主机上运行。 mco是我们公司的简称。 我一直在遵循Identity Server 4的指示启动并运行。 码 我不包括docker-compose.debug.yml因为它运行的命令仅适用于在Visual Studio中运行。 泊坞窗,compose.yml version: '2' services: mcodatabase: image: mcodatabase build: context: ./Data dockerfile: Dockerfile restart: always ports: – 9876:5432 environment: POSTGRES_USER: mcodevuser POSTGRES_PASSWORD: password POSTGRES_DB: mcodev volumes: – […]

Identity Server 4和Docker

我试图configurationDocker的IdentityServer4,但我不能让它的工作。 为了开始,我使用了身份服务器文档的Client Credential示例: 使用Client Credentials保护API IdentityServer 托pipe在5000端口上 的WebAPI 托pipe在港口5001 在我的WebApi的Startup.cs文件的Configure方法中,我做了以下操作(问题可能在这里): app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions { Authority = "http://web:5000", RequireHttpsMetadata = false, ApiName = "api1" }); 客户 和客户 // Everything is fine here… var disco = await DiscoveryClient.GetAsync("http://localhost:5000"); var tokenClient = new TokenClient(disco.TokenEndpoint, "client", "secret"); var tokenResponse = await tokenClient.RequestClientCredentialsAsync("api"); // This does not work var client = […]

在Docker中运行.Net Core 2.0上的IdentityServer4 – 访问主机资源

我试图将一个.Net Core 2.0应用程序的服务(IdentityServer 4 v2)转换为在Docker for Windows上运行。 这只在开发工作站上。 我做了标准的Visual Studio 2017“添加Docker支持”到现有的Net Core 2.0服务。 服务启动正常,但由于这些问题而失败: 该服务正在寻找安装在本地主机上的证书。 在Docker中运行它没有看到这个证书。 该服务使用主机的etc / host文件来查找我们的数据库服务器的DNS。 在Docker上运行的服务没有看到主机的DNS。 我试图将docker中的network_mode设置为“host”,但无法构build。 build立这样一个环境的build议方式是什么? 运行时是使用docker撰写的,默认的撰写和configuration非常简单: version: '3' services: identity.server: image: identity.server ports: – "8100:8100" build: context: ./src/Identity.Server dockerfile: Dockerfile 引用的dockerfile: FROM microsoft/dotnet:2.0-runtime ARG source WORKDIR /app COPY ${source:-obj/Docker/publish} . ENTRYPOINT ["dotnet", "Identity.Server.dll"] 我已经阅读了下面的答案,但它似乎不工作在.net本身: https : //devops.stackexchange.com/questions/1501/configure-docker-to-use-ssl-for-a-private -registry上-窗口10?newreg […]