From 9c6b4d159712340a2af7459f7c5ad17247649af6 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 11 Jan 2018 21:36:36 +0100 Subject: [PATCH] log credentials --- testOauthClient/Startup.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/testOauthClient/Startup.cs b/testOauthClient/Startup.cs index 9758793b..5f84a922 100755 --- a/testOauthClient/Startup.cs +++ b/testOauthClient/Startup.cs @@ -65,7 +65,11 @@ namespace testOauthClient options.AuthenticationDescriptions.Clear(); }); app.UseStaticFiles(); - + var authConf = Configuration.GetSection("Authentication").GetSection("Yavsc"); + var clientId = authConf.GetSection("ClientId").Value; + var clientSecret = authConf.GetSection("ClientSecret").Value; + var logger = loggerFactory.CreateLogger(); + logger.LogInformation($"## ClientId: {clientId} ClientSecret: {clientSecret}"); app.UseCookieAuthentication(new CookieAuthenticationOptions { AutomaticAuthenticate = true, @@ -82,13 +86,15 @@ namespace testOauthClient { options.AuthenticationScheme = "Yavsc"; options.AuthorizationEndpoint = $"{host}/authorize"; - options.TokenEndpoint = $"{host}/dev.pschneider.fr/token"; + options.TokenEndpoint = $"{host}/token"; options.CallbackPath = new PathString("/signin-yavsc"); - options.ClientId = "[Your client Id]"; - options.ClientSecret = "blih"; + options.DisplayName = "Yavsc dev"; + options.ClientId = clientId; + options.ClientSecret = clientSecret; options.Scope.Add("profile"); options.SaveTokensAsClaims = true; options.UserInformationEndpoint = $"{host}/api/me"; + options.Events = new OAuthEvents { OnCreatingTicket = async context =>