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
This commit is contained in:
Sam 2026-02-06 00:47:06 +08:00
parent c998686ab6
commit 635e3b6c86
2 changed files with 16 additions and 4 deletions

View File

@ -34,7 +34,13 @@ public static class OpenIddictSetup
.AllowRefreshTokenFlow() .AllowRefreshTokenFlow()
.RequireProofKeyForCodeExchange(); .RequireProofKeyForCodeExchange();
options.RegisterScopes("api", "offline_access"); options.RegisterScopes(
"openid",
"profile",
"email",
"api",
"offline_access"
);
}); });
} }

View File

@ -127,9 +127,15 @@ public static class SeedData
ClientId = "fengling-console", ClientId = "fengling-console",
ClientSecret = "console-secret-change-in-production", ClientSecret = "console-secret-change-in-production",
DisplayName = "Fengling 运管中心", DisplayName = "Fengling 运管中心",
RedirectUris = new[] { "http://console.fengling.local/auth/callback" }, RedirectUris = new[] {
PostLogoutRedirectUris = new[] { "http://console.fengling.local/" }, "http://console.fengling.local/auth/callback",
Scopes = new[] { "api", "offline_access" }, "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" }, GrantTypes = new[] { "authorization_code", "refresh_token" },
ClientType = "confidential", ClientType = "confidential",
ConsentType = "implicit", ConsentType = "implicit",