From 635e3b6c86ee39199726d52a0a5cb5defd718303 Mon Sep 17 00:00:00 2001 From: Sam <315859133@qq.com> Date: Fri, 6 Feb 2026 00:47:06 +0800 Subject: [PATCH] feat: configure OAuth client for Fengling Console - Add localhost:5777 callback URIs to fengling-console client - Register OIDC scopes: openid, profile, email - Add support for development environment --- Configuration/OpenIddictSetup.cs | 8 +++++++- Data/SeedData.cs | 12 +++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Configuration/OpenIddictSetup.cs b/Configuration/OpenIddictSetup.cs index 8d5abcd..8ee1b9e 100644 --- a/Configuration/OpenIddictSetup.cs +++ b/Configuration/OpenIddictSetup.cs @@ -34,7 +34,13 @@ public static class OpenIddictSetup .AllowRefreshTokenFlow() .RequireProofKeyForCodeExchange(); - options.RegisterScopes("api", "offline_access"); + options.RegisterScopes( + "openid", + "profile", + "email", + "api", + "offline_access" + ); }); } diff --git a/Data/SeedData.cs b/Data/SeedData.cs index e5184c4..351aaba 100644 --- a/Data/SeedData.cs +++ b/Data/SeedData.cs @@ -127,9 +127,15 @@ public static class SeedData ClientId = "fengling-console", ClientSecret = "console-secret-change-in-production", DisplayName = "Fengling 运管中心", - RedirectUris = new[] { "http://console.fengling.local/auth/callback" }, - PostLogoutRedirectUris = new[] { "http://console.fengling.local/" }, - Scopes = new[] { "api", "offline_access" }, + RedirectUris = new[] { + "http://console.fengling.local/auth/callback", + "http://localhost:5777/callback" + }, + PostLogoutRedirectUris = new[] { + "http://console.fengling.local/", + "http://localhost:5777/" + }, + Scopes = new[] { "openid", "profile", "email", "api", "offline_access" }, GrantTypes = new[] { "authorization_code", "refresh_token" }, ClientType = "confidential", ConsentType = "implicit",