feat(auth): pre-register Fengling.Console as OAuth client

This commit is contained in:
Sam 2026-02-02 09:59:32 +08:00
parent cda6225bc5
commit 9059c56515
12 changed files with 27 additions and 5 deletions

View File

@ -77,5 +77,27 @@ public static class SeedData
await userManager.AddToRoleAsync(testUser, "User"); await userManager.AddToRoleAsync(testUser, "User");
} }
} }
var consoleClient = await context.OAuthApplications
.FirstOrDefaultAsync(c => c.ClientId == "fengling-console");
if (consoleClient == null)
{
consoleClient = new OAuthApplication
{
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" },
GrantTypes = new[] { "authorization_code", "refresh_token" },
ClientType = "confidential",
ConsentType = "implicit",
Status = "active",
CreatedAt = DateTime.UtcNow
};
context.OAuthApplications.Add(consoleClient);
await context.SaveChangesAsync();
}
} }
} }

View File

@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Fengling.AuthService")] [assembly: System.Reflection.AssemblyCompanyAttribute("Fengling.AuthService")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d3810f5d43139224571e9558a8f9d1caf253a2af")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+5cdcba7e57f11cbe819ef947fe4f31dfa3f31ce5")]
[assembly: System.Reflection.AssemblyProductAttribute("Fengling.AuthService")] [assembly: System.Reflection.AssemblyProductAttribute("Fengling.AuthService")]
[assembly: System.Reflection.AssemblyTitleAttribute("Fengling.AuthService")] [assembly: System.Reflection.AssemblyTitleAttribute("Fengling.AuthService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
6eb848986322eda4a24415ea7940bb6189775a7373c0cc69971ba237cf3fdeb1 88557c3b57a3995d38feba9efb65b2d453135485aca705ead19cfd3379fa5af3

View File

@ -1 +1 @@
246db42ea15f5b11045c9c9e1cfc0e315b80d78a560048b99d9119120a177411 a442fae7d5599fed904d1202772e57ff3d3723e8af039346ca13fe6adc50709d

View File

@ -1 +1 @@
{"GlobalPropertiesHash":"kj0YdTIP9epXJ4ydBR9yaRr5OemJ36+FlRmnBdiGrUE=","FingerprintPatternsHash":"gq3WsqcKBUGTSNle7RKKyXRIwh7M8ccEqOqYvIzoM04=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["nGadCmuBEG\u002BKUP6Powa57G4ZzOO6ibT7XQKZuYm3g44=","elQhyiEcBZcCHMIxyXyx47S4otwc/MEXjAYU/dca/hQ=","XrkTC/5D0wT4Vj8udAqp\u002B2DDPMQ5H3P4YZDu2X62NzI=","chR\u002BAL8taCFTQytCSiXtu6MS2y5z2GmMYAK8xprfbvA=","QUvWOS2l6Gf\u002Bb29f7UDXsp99Km48zx\u002BXUkHxYrdP5O4=","Zj1gozVje0UGK1srrd8TNGYUEXHzQpz/esP\u002BUaINhMs=","587UMkRW9Duvi09dG2y/rsS2zVrz865mHwElGvidCDE=","7HE6TnPvLegH\u002BkmPfdNuw7C6mM5Vgea4zehQVjDOli4="],"CachedAssets":{},"CachedCopyCandidates":{}} {"GlobalPropertiesHash":"kj0YdTIP9epXJ4ydBR9yaRr5OemJ36+FlRmnBdiGrUE=","FingerprintPatternsHash":"gq3WsqcKBUGTSNle7RKKyXRIwh7M8ccEqOqYvIzoM04=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["nGadCmuBEG\u002BKUP6Powa57G4ZzOO6ibT7XQKZuYm3g44=","elQhyiEcBZcCHMIxyXyx47S4otwc/MEXjAYU/dca/hQ=","XrkTC/5D0wT4Vj8udAqp\u002B2DDPMQ5H3P4YZDu2X62NzI=","chR\u002BAL8taCFTQytCSiXtu6MS2y5z2GmMYAK8xprfbvA=","QUvWOS2l6Gf\u002Bb29f7UDXsp99Km48zx\u002BXUkHxYrdP5O4=","Zj1gozVje0UGK1srrd8TNGYUEXHzQpz/esP\u002BUaINhMs=","587UMkRW9Duvi09dG2y/rsS2zVrz865mHwElGvidCDE=","2BIhuv/t6BVBKzkDXJ\u002BLBW5o61ISoGgjQ1cATL0tWlw="],"CachedAssets":{},"CachedCopyCandidates":{}}

View File

@ -1 +1 @@
{"GlobalPropertiesHash":"cWEb6+iVjovCYrac7gX+Ogl5Z4cMpIEURSADGbv9ou0=","FingerprintPatternsHash":"gq3WsqcKBUGTSNle7RKKyXRIwh7M8ccEqOqYvIzoM04=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["nGadCmuBEG\u002BKUP6Powa57G4ZzOO6ibT7XQKZuYm3g44=","elQhyiEcBZcCHMIxyXyx47S4otwc/MEXjAYU/dca/hQ=","XrkTC/5D0wT4Vj8udAqp\u002B2DDPMQ5H3P4YZDu2X62NzI=","chR\u002BAL8taCFTQytCSiXtu6MS2y5z2GmMYAK8xprfbvA=","QUvWOS2l6Gf\u002Bb29f7UDXsp99Km48zx\u002BXUkHxYrdP5O4=","Zj1gozVje0UGK1srrd8TNGYUEXHzQpz/esP\u002BUaINhMs=","587UMkRW9Duvi09dG2y/rsS2zVrz865mHwElGvidCDE=","7HE6TnPvLegH\u002BkmPfdNuw7C6mM5Vgea4zehQVjDOli4="],"CachedAssets":{},"CachedCopyCandidates":{}} {"GlobalPropertiesHash":"cWEb6+iVjovCYrac7gX+Ogl5Z4cMpIEURSADGbv9ou0=","FingerprintPatternsHash":"gq3WsqcKBUGTSNle7RKKyXRIwh7M8ccEqOqYvIzoM04=","PropertyOverridesHash":"8ZRc1sGeVrPBx4lD717BgRaQekyh78QKV9SKsdt638U=","InputHashes":["nGadCmuBEG\u002BKUP6Powa57G4ZzOO6ibT7XQKZuYm3g44=","elQhyiEcBZcCHMIxyXyx47S4otwc/MEXjAYU/dca/hQ=","XrkTC/5D0wT4Vj8udAqp\u002B2DDPMQ5H3P4YZDu2X62NzI=","chR\u002BAL8taCFTQytCSiXtu6MS2y5z2GmMYAK8xprfbvA=","QUvWOS2l6Gf\u002Bb29f7UDXsp99Km48zx\u002BXUkHxYrdP5O4=","Zj1gozVje0UGK1srrd8TNGYUEXHzQpz/esP\u002BUaINhMs=","587UMkRW9Duvi09dG2y/rsS2zVrz865mHwElGvidCDE=","2BIhuv/t6BVBKzkDXJ\u002BLBW5o61ISoGgjQ1cATL0tWlw="],"CachedAssets":{},"CachedCopyCandidates":{}}