Id Stores from db

This commit is contained in:
Paul Schneider 2025-08-24 16:07:53 +01:00
commit 03161bbfb6
23 changed files with 2932 additions and 231 deletions

View file

@ -123,32 +123,7 @@ namespace isnd.tests
TestClientId = "testClientId";
TestingUser = await dbContext.Users.FirstOrDefaultAsync(u => u.UserName == TestingUserName);
EnsureUser(TestingUserName, TestingUserPassword);
// ensure a client
var testClient = await dbContext.Client.FirstOrDefaultAsync((c) => c.Id == TestClientId);
if (testClient == null)
{
testClient = new Yavsc.Models.Auth.Client
{
Id = TestClientId,
DisplayName = "Testing Client",
Secret = TestClientSecret,
Active = true,
Type = ApplicationTypes.NativeConfidential,
AccessTokenLifetime = 900,
RefreshTokenLifeTime = 15000
};
dbContext.Client.Add(testClient);
dbContext.SaveChanges();
}
else
{
testClient.DisplayName = "Testing Client";
testClient.Secret = TestClientSecret;
testClient.Active = true;
testClient.Type = ApplicationTypes.NativeConfidential;
testClient.AccessTokenLifetime = 900;
testClient.RefreshTokenLifeTime = 1500;
}
}
public void EnsureUser(string testingUserName, string password)