From 6fc64ddae235ea0b8dc7dca4ddde5e5a7203a6ec Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Tue, 28 Jul 2020 13:06:29 -0700 Subject: [PATCH] Http for identity --- samples/voting/IdentityServer/Startup.cs | 23 +++++------------------ samples/voting/results/Startup.cs | 3 ++- samples/voting/tye.yaml | 15 +++++++++++---- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/samples/voting/IdentityServer/Startup.cs b/samples/voting/IdentityServer/Startup.cs index 0816c4c8..8061e6e2 100644 --- a/samples/voting/IdentityServer/Startup.cs +++ b/samples/voting/IdentityServer/Startup.cs @@ -49,7 +49,6 @@ namespace IdentityServer // in-memory, code config builder.AddInMemoryIdentityResources(Config.IdentityResources); // builder.AddInMemoryApiScopes(Config.ApiScopes); - Console.WriteLine(Configuration.GetServiceUri("results:https")); builder.AddInMemoryClients(new Client[] { // m2m client credentials flow client @@ -61,30 +60,18 @@ namespace IdentityServer AllowedGrantTypes = GrantTypes.Code, - RedirectUris = { $"{Configuration.GetServiceUri("results:https")}signin-oidc" }, - FrontChannelLogoutUri = $"{Configuration.GetServiceUri("results:https")}signout-oidc", - PostLogoutRedirectUris = { $"{Configuration.GetServiceUri("results:https")}signout-callback-oidc" }, + RedirectUris = { $"{Configuration.GetServiceUri("results:http")}signin-oidc" }, + FrontChannelLogoutUri = $"{Configuration.GetServiceUri("results:http")}signout-oidc", + PostLogoutRedirectUris = { $"{Configuration.GetServiceUri("results:http")}signout-callback-oidc" }, AllowOfflineAccess = true, - // AllowedCorsOrigins = { $"{Configuration.GetServiceUri("results:https")}" }, + // AllowedCorsOrigins = { $"{Configuration.GetServiceUri("results")}" }, AllowedScopes = new List{IdentityServerConstants.StandardScopes.OpenId,IdentityServerConstants.StandardScopes.Profile, "scope"} }, }); // not recommended for production - you need to store your key material somewhere secure builder.AddDeveloperSigningCredential(); - - services.AddAuthentication() - .AddGoogle(options => - { - options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme; - - // register your IdentityServer with Google at https://console.developers.google.com - // enable the Google+ API - // set the redirect URI to https://localhost:5001/signin-google - options.ClientId = "copy client ID from Google here"; - options.ClientSecret = "copy client secret from Google here"; - }); } public void Configure(IApplicationBuilder app) @@ -105,4 +92,4 @@ namespace IdentityServer }); } } -} \ No newline at end of file +} diff --git a/samples/voting/results/Startup.cs b/samples/voting/results/Startup.cs index 8610e2a2..d8a0221b 100644 --- a/samples/voting/results/Startup.cs +++ b/samples/voting/results/Startup.cs @@ -34,11 +34,12 @@ namespace Results .AddCookie("Cookies") .AddOpenIdConnect("oidc", options => { - options.Authority = Configuration.GetServiceUri("identityserver:https").AbsoluteUri; + options.Authority = Configuration.GetServiceUri("identityserver:http").AbsoluteUri; options.ClientId = "interactive"; options.ClientSecret = "49C1A7E1-0C79-4A89-A3D6-A37998FB86B0"; options.ResponseType = "code"; options.SaveTokens = true; + options.RequireHttpsMetadata = false; }); } diff --git a/samples/voting/tye.yaml b/samples/voting/tye.yaml index c96babe2..fcbbe96a 100644 --- a/samples/voting/tye.yaml +++ b/samples/voting/tye.yaml @@ -20,10 +20,17 @@ services: - name: results project: results/results.csproj bindings: - - name: https - protocol: https + - name: http + protocol: http - name: identityserver project: IdentityServer/IdentityServer.csproj bindings: - - name: https - protocol: https + - name: http + protocol: http +# ingress: +# - name: ingress +# rules: +# - path: /vote +# service: vote +# - path: /results +# service: results \ No newline at end of file