-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this service addresses #3
- Loading branch information
Showing
22 changed files
with
298 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
authentication/authentication.web.api/Controllers/UserController.cs
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
authentication/authentication.web.api/Controllers/ValuesController.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
authentication/authentication.web.api/appsettings.Development.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
authentication/authentication.web.api/authentication.web.api.csproj
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
authentication/lifebook.authentication.core/dbcontext/ApiResourcesDbContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using IdentityServer4.EntityFramework.Entities; | ||
using lifebook.core.database.databaseprovider.services; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace lifebook.authentication.core.dbcontext | ||
{ | ||
public class ApiResourcesDbContext : SqlServerDatabaseProvider | ||
{ | ||
public DbSet<ApiResource> ApiResources { get; set; } | ||
|
||
public ApiResourcesDbContext() : base("lifebook.oauth") | ||
{ | ||
} | ||
|
||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
authentication/lifebook.authentication.core/dbcontext/ClientDbContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using IdentityServer4.EntityFramework.Entities; | ||
using lifebook.core.database.databaseprovider.services; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace lifebook.authentication.core.dbcontext | ||
{ | ||
public class ClientDbContext : SqlServerDatabaseProvider | ||
{ | ||
public DbSet<Client> Clients { get; set; } | ||
|
||
public ClientDbContext() : base("lifebook.oauth") | ||
{ | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
authentication/lifebook.authentication.core/dbcontext/IdentityServerDbContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using IdentityServer4.EntityFramework.DbContexts; | ||
using IdentityServer4.EntityFramework.Entities; | ||
using lifebook.core.database.databaseprovider.services; | ||
|
||
namespace lifebook.authentication.core.dbcontext | ||
{ | ||
public class IdentityServerDbContext : SqlServerDatabaseProvider | ||
{ | ||
public ConfigurationDbContext ConfigurationDbContext { get; private set; } | ||
public PersistedGrantDbContext PersistedGrantDbContext { get; private set; } | ||
public string ConnectionString => $@"Server={Host},{Port};Database={DatabaseName};User={Username};Password={Password};"; | ||
|
||
public IdentityServerDbContext(ConfigurationDbContext configurationDbContext, PersistedGrantDbContext persistedGrantDbContext) : base("lifebook.oauth") | ||
|
||
{ | ||
ConfigurationDbContext = configurationDbContext; | ||
PersistedGrantDbContext = persistedGrantDbContext; | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
authentication/lifebook.authentication.core/ioc/Bootloader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using Castle.MicroKernel.Registration; | ||
using Castle.MicroKernel.SubSystems.Configuration; | ||
using Castle.Windsor; | ||
using Castle.Windsor.Installer; | ||
using lifebook.authentication.core.ioc.installers; | ||
|
||
namespace lifebook.authentication.core.ioc | ||
{ | ||
public class Bootloader : IWindsorInstaller | ||
{ | ||
public void Install(IWindsorContainer container, IConfigurationStore store) | ||
{ | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
authentication/lifebook.authentication.core/ioc/installers/DefaultInstaller.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using Castle.MicroKernel.Registration; | ||
using Castle.MicroKernel.SubSystems.Configuration; | ||
using Castle.Windsor; | ||
using IdentityServer4.EntityFramework.DbContexts; | ||
using lifebook.authentication.core.dbcontext; | ||
using lifebook.authentication.core.repository; | ||
|
||
namespace lifebook.authentication.core.ioc.installers | ||
{ | ||
public class DefaultInstaller : IWindsorInstaller | ||
{ | ||
public void Install(IWindsorContainer container, IConfigurationStore store) | ||
{ | ||
container.Register( | ||
Component.For<IdentityServerDbContext>().IsDefault().LifestyleTransient().Named("lifebook.authentication.core.IdentityServerDbContext"), | ||
Component.For<ApiResourcesDbContext>().IsDefault().LifestyleTransient(), | ||
Component.For<ApiRepository>().IsDefault().LifestyleTransient(), | ||
Component.For<ClientDbContext>().IsDefault().LifestyleTransient(), | ||
Component.For<ClientRepository>().IsDefault().LifestyleTransient() | ||
); | ||
} | ||
} | ||
} |
Oops, something went wrong.