a client store

This commit is contained in:
Paul Schneider
2025-07-15 17:35:14 +01:00
parent 1e766f4718
commit f43fd76baa
6 changed files with 80 additions and 57 deletions

View File

@ -31,38 +31,34 @@ public static class Config
/// <summary>
/// Lists Available user profile classes,
/// populated at startup, using reflexion.
/// populated at startup, using reflection.
/// </summary>
public static List<Type> ProfileTypes = new List<Type>();
public static IEnumerable<IdentityResource> IdentityResources =>
new IdentityResource[]
{
[
new IdentityResources.OpenId(),
new IdentityResources.Profile(),
new IdentityResources.Email()
};
];
public static IEnumerable<ApiScope> ApiScopes =>
new ApiScope[]
{
public static IEnumerable<ApiScope> TestingApiScopes =>
[
new ApiScope("scope1",new string[] {"scope1"}),
new ApiScope("scope2",new string[] {"scope2"}),
};
];
public static IEnumerable<Client> Clients =>
new Client[]
{
public static IEnumerable<Client> TestingClients =>
[
// m2m client credentials flow client
new Client
{
ClientId = "m2m.client",
ClientName = "Client Credentials Client",
AllowedGrantTypes = GrantTypes.ClientCredentials,
ClientSecrets = { new Secret("511536EF-F270-4058-80CA-1C89C192F69A".Sha256()) },
AllowedGrantTypes = GrantTypes.ClientCredentials,
AllowedScopes = { "scope1" }
},
@ -87,7 +83,7 @@ public static class Config
IdentityServerConstants.StandardScopes.OfflineAccess,
"scope2" },
},
};
];
public static PayPalSettings? PayPalSettings { get; set; }
}

View File

@ -1,17 +1,22 @@

using Yavsc.Models.Haircut;
using Yavsc.Models.IT.Evolution;
using Yavsc.Models.IT.Fixing;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Yavsc.Abstract.Models.Messaging;
using Yavsc.Server.Models.EMailing;
using Yavsc.Server.Models.IT.SourceCode;
using Yavsc.Server.Models.IT;
using Yavsc.Models.Streaming;
using Yavsc.Abstract.Identity;
using Yavsc.Server.Models.Calendar;
namespace Yavsc.Models
{
using Haircut;
using IT.Evolution;
using IT.Fixing;
using Streaming;
using Relationship;
using Forms;
using Yavsc;
using Auth;
using Billing;
using Musical;
@ -28,18 +33,13 @@ namespace Yavsc.Models
using Bank;
using Payment;
using Blog;
using Yavsc.Abstract.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Yavsc.Server.Models.Calendar;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using Yavsc.Abstract.Models.Messaging;
using Microsoft.Extensions.Logging;
using System.Configuration;
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
@ -272,8 +272,8 @@ namespace Yavsc.Models
public DbSet<InstrumentRating> InstrumentRating { get; set; }
public DbSet<Scope> Scopes { get; set; }
public DbSet<BlogSpotPublication> blogSpotPublications{ get; set; }
// public DbSet<IdentityUserLogin<String>> AspNetUserLogins { get; set; }
public DbSet<BlogSpotPublication> blogSpotPublications { get; set; }
public DbSet<Client> Client { get; set; }
}
}