Added request logging to see the actual requests to the SteamOpenIdConnectProvider

Fixed config variable names
Updated Player with strings instead of ulong
This commit is contained in:
Mark Ettema 2021-05-20 21:22:01 +07:00
parent 8cbd103532
commit c12ce382d8
8 changed files with 15 additions and 39 deletions

1
.gitattributes vendored
View file

@ -2,6 +2,7 @@
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
*.sh text eol=lf
###############################################################################
# Set default behavior for command prompt diff.

View file

@ -1,22 +1,3 @@
# Create the file docker-compose.secrets.yml and add
# ```
# version: '2'
# services:
# proxy:
# volumes:
# - "<your-certs>/dev.local.crt:/tmp/dev.local.crt"
# - "<your-certs>/dev.local.key:/tmp/dev.local.key"
#
# keycloak:
# volumes:
# - "<your-certs>/dev.local.crt:/tmp/dev.local.crt"
#
# steamidp:
# environment:
# Steam__ApplicationKey: <your-app-key>
# ```
#
# Than start with `docker compose -f .\docker-compose.yml -f .\docker-compose.secrets.yml up`
version: '2'
volumes:
postgres_data:

View file

@ -1,4 +1,4 @@
using System.Text.Json;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SteamOpenIdConnectProvider.Profile.Models
@ -6,7 +6,7 @@ namespace SteamOpenIdConnectProvider.Profile.Models
public sealed class Player
{
[JsonPropertyName("steamid")]
public ulong SteamId { get; set; }
public string SteamId { get; set; }
[JsonPropertyName("communityvisibilitystate")]
public int CommunityVisibilityState { get; set; }
@ -45,7 +45,7 @@ namespace SteamOpenIdConnectProvider.Profile.Models
public string RealName { get; set; }
[JsonPropertyName("primaryclanid")]
public ulong PrimaryClanId { get; set; }
public string PrimaryClanId { get; set; }
[JsonPropertyName("timecreated")]
public int TimeCreated { get; set; }
@ -56,4 +56,4 @@ namespace SteamOpenIdConnectProvider.Profile.Models
[JsonPropertyName("loccountrycode")]
public string LocCountryCode { get; set; }
}
}
}

View file

@ -9,6 +9,6 @@ namespace SteamOpenIdConnectProvider.Domains.Steam
{
public static readonly string Key = "Steam";
public string ApplicationKey { get; internal set; }
public string ApplicationKey { get; set; }
}
}

View file

@ -15,8 +15,9 @@ namespace SteamOpenIdConnectProvider
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("System", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Literate)
.WriteTo.Console()
.CreateLogger();
CreateWebHostBuilder(args).Build().Run();

View file

@ -16,6 +16,9 @@ using SteamOpenIdConnectProvider.Models.IdentityServer;
using SteamOpenIdConnectProvider.Domains.Common;
using SteamOpenIdConnectProvider.Domains.IdentityServer;
using SteamOpenIdConnectProvider.Domains.Steam;
using System.IO;
using System.Text;
using Serilog;
namespace SteamOpenIdConnectProvider
{
@ -87,6 +90,8 @@ namespace SteamOpenIdConnectProvider
app.UsePathBase(hostingConfig.BasePath);
}
app.UseSerilogRequestLogging();
app.UseCookiePolicy();
app.Use(async (ctx, next) =>
{

View file

@ -1,12 +1,5 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
},
"Hosting": {
"PathBase": "/steam"
"BasePath": "/steam"
}
}

View file

@ -1,9 +1,4 @@
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"AllowedHosts": "*",
"OpenID": {
"ClientID": "keycloak",
@ -13,7 +8,7 @@
"PostLogoutRedirectUri": ""
},
"Hosting": {
"PathBase": ""
"BasePath": ""
},
"Steam": {
"ApplicationKey": "secret"