diff --git a/DysonNetwork.Sphere/Auth/OpenId/DiscordOidcService.cs b/DysonNetwork.Sphere/Auth/OpenId/DiscordOidcService.cs index ebf6d79..c1b7366 100644 --- a/DysonNetwork.Sphere/Auth/OpenId/DiscordOidcService.cs +++ b/DysonNetwork.Sphere/Auth/OpenId/DiscordOidcService.cs @@ -32,7 +32,18 @@ public class DiscordOidcService( var queryString = string.Join("&", queryParams.Select(p => $"{p.Key}={Uri.EscapeDataString(p.Value)}")); return $"https://discord.com/api/oauth2/authorize?{queryString}"; } - + + protected override async Task GetDiscoveryDocumentAsync() + { + return new OidcDiscoveryDocument + { + AuthorizationEndpoint = "https://discord.com/oauth2/authorize", + TokenEndpoint = "https://discord.com/api/oauth2/token", + UserinfoEndpoint = "https://discord.com/api/users/@me", + JwksUri = null + }; + } + public override async Task ProcessCallbackAsync(OidcCallbackData callbackData) { var tokenResponse = await ExchangeCodeForTokensAsync(callbackData.Code); diff --git a/DysonNetwork.Sphere/Auth/OpenId/OidcService.cs b/DysonNetwork.Sphere/Auth/OpenId/OidcService.cs index c0a3f4b..544704a 100644 --- a/DysonNetwork.Sphere/Auth/OpenId/OidcService.cs +++ b/DysonNetwork.Sphere/Auth/OpenId/OidcService.cs @@ -65,7 +65,7 @@ public abstract class OidcService( /// /// Retrieves the OpenID Connect discovery document /// - protected async Task GetDiscoveryDocumentAsync() + protected virtual async Task GetDiscoveryDocumentAsync() { // Construct a cache key unique to the current provider: var cacheKey = $"oidc-discovery:{ProviderName}";