log credentials

main
Paul Schneider 8 years ago
parent eebf9399c0
commit 9c6b4d1597
1 changed files with 10 additions and 4 deletions

@ -65,7 +65,11 @@ namespace testOauthClient
options.AuthenticationDescriptions.Clear(); options.AuthenticationDescriptions.Clear();
}); });
app.UseStaticFiles(); 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<Startup>();
logger.LogInformation($"## ClientId: {clientId} ClientSecret: {clientSecret}");
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseCookieAuthentication(new CookieAuthenticationOptions
{ {
AutomaticAuthenticate = true, AutomaticAuthenticate = true,
@ -82,13 +86,15 @@ namespace testOauthClient
{ {
options.AuthenticationScheme = "Yavsc"; options.AuthenticationScheme = "Yavsc";
options.AuthorizationEndpoint = $"{host}/authorize"; options.AuthorizationEndpoint = $"{host}/authorize";
options.TokenEndpoint = $"{host}/dev.pschneider.fr/token"; options.TokenEndpoint = $"{host}/token";
options.CallbackPath = new PathString("/signin-yavsc"); options.CallbackPath = new PathString("/signin-yavsc");
options.ClientId = "[Your client Id]"; options.DisplayName = "Yavsc dev";
options.ClientSecret = "blih"; options.ClientId = clientId;
options.ClientSecret = clientSecret;
options.Scope.Add("profile"); options.Scope.Add("profile");
options.SaveTokensAsClaims = true; options.SaveTokensAsClaims = true;
options.UserInformationEndpoint = $"{host}/api/me"; options.UserInformationEndpoint = $"{host}/api/me";
options.Events = new OAuthEvents options.Events = new OAuthEvents
{ {
OnCreatingTicket = async context => OnCreatingTicket = async context =>

Loading…