Compare commits

..
1 Commits
Author SHA1 Message Date
saherelm df3ed7868b last ... 2026-11-08 17:59:00 +03:30
3 changed files with 446 additions and 405 deletions
+10 -1
View File
@@ -6,6 +6,7 @@ using xIds.Providers;
using Newtonsoft.Json; using Newtonsoft.Json;
using xIds.Interfaces; using xIds.Interfaces;
using System.Reflection; using System.Reflection;
using xLoggingService.DI;
using xStorageService.DI; using xStorageService.DI;
using xCommons.Extensions; using xCommons.Extensions;
using xCommons.Configurations; using xCommons.Configurations;
@@ -29,6 +30,7 @@ namespace xIds
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddXLoggingService(Configuration);
// //
// Register Validation Provider and all XCommons Module Services ... // Register Validation Provider and all XCommons Module Services ...
services.AddXCommons(Configuration); services.AddXCommons(Configuration);
@@ -78,7 +80,11 @@ namespace xIds
services.AddSingleton<IXSecurityProvider, XSecurityProvider>(); services.AddSingleton<IXSecurityProvider, XSecurityProvider>();
} }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger<Startup> logger) public void Configure(
IApplicationBuilder app,
IWebHostEnvironment env,
ILogger<Startup> logger
)
{ {
// //
if (env.IsDevelopment()) if (env.IsDevelopment())
@@ -125,3 +131,6 @@ namespace xIds
} }
} }
} }
+43 -2
View File
@@ -250,7 +250,9 @@
} }
], ],
"Enabled": true, "Enabled": true,
"RedirectUris": ["https://localhost:5001/signin-oidc"], "RedirectUris": [
"https://localhost:5001/signin-oidc"
],
"AllowedGrantTypes": [ "AllowedGrantTypes": [
"hybrid", "hybrid",
"password", "password",
@@ -285,7 +287,12 @@
"DeviceCodeLifetime": 300 "DeviceCodeLifetime": 300
} }
], ],
"IdentityResources": ["openid", "profile", "email", "role"], "IdentityResources": [
"openid",
"profile",
"email",
"role"
],
"ApiResources": [ "ApiResources": [
{ {
"Name": "IdentityServerApi" "Name": "IdentityServerApi"
@@ -391,6 +398,40 @@
"Default": "Information", "Default": "Information",
"Microsoft": "Warning", "Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information" "Microsoft.Hosting.Lifetime": "Information"
},
"XLogger": {
"Enabled": true,
"ApplicationName": "xIds",
"EnvironmentName": "Production",
"MinimumLevel": "Information",
"Queue": {
"Enabled": true,
"Capacity": 10000,
"ShutdownTimeoutSeconds": 10
},
"File": {
"Enabled": true,
"Directory": "./Logs",
"FileName": "xIds-.log",
"Format": "Json",
"MinimumLevel": "Information",
"RetainedFileCountLimit": 30
},
"Database": {
"Enabled": false,
"Provider": "Microsoft.Data.Sqlite",
"ConnectionString": "Filename=./Db/XLogs.db",
"TableName": "XLogs",
"AutoCreateTable": true,
"MinimumLevel": "Warning"
},
"Event": {
"Enabled": false,
"Topic": "application-logs",
"Action": "ApplicationLogCreated",
"Sender": "xIds",
"MinimumLevel": "Error"
}
} }
}, },
"AllowedHosts": "*" "AllowedHosts": "*"
+5 -14
View File
@@ -7,32 +7,25 @@
<PackageId>xSaherElm.xIds</PackageId> <PackageId>xSaherElm.xIds</PackageId>
<Company>SaherElm IT Center</Company> <Company>SaherElm IT Center</Company>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<Description> <Description>
this project is an Identity Server for xSaherElm projects which provides Authentication and this project is an Identity Server for xSaherElm projects which provides Authentication and
Authorization of User's. Authorization of User's.
</Description> </Description>
<!-- Icon Definition --> <!-- Icon Definition -->
<PackageIcon>icon.png</PackageIcon> <PackageIcon>icon.png</PackageIcon>
<!-- Fix Duplicate TargetFramework Issue --> <!-- Fix Duplicate TargetFramework Issue -->
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute> <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup> </PropertyGroup>
<!-- Icon Handling --> <!-- Icon Handling -->
<ItemGroup> <ItemGroup>
<None Include="../../Resources/Images/favicon.png" Link="icon.png" Pack="true" <None Include="../../Resources/Images/favicon.png" Link="icon.png" Pack="true" PackagePath="\icon.png" />
PackagePath="\icon.png" />
</ItemGroup> </ItemGroup>
<!-- Local Dependencies --> <!-- Local Dependencies -->
<ItemGroup> <ItemGroup>
<!-- <PackageReference Include="xDashboard.xMessageService" Version="1.0.0" /> <!-- <PackageReference Include="xDashboard.xMessageService" Version="1.0.0" />
<PackageReference Include="xDashboard.xStorageService" Version="1.0.0" /> --> <PackageReference Include="xDashboard.xStorageService" Version="1.0.0" /> -->
</ItemGroup> </ItemGroup>
<!-- Project Dependencies --> <!-- Project Dependencies -->
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Modules\xIdentityHelper\xIdentityHelper.csproj" /> <ProjectReference Include="..\Modules\xIdentityHelper\xIdentityHelper.csproj" />
@@ -40,7 +33,6 @@
<ProjectReference Include="..\Modules\xStorageService\xStorageService.csproj" /> <ProjectReference Include="..\Modules\xStorageService\xStorageService.csproj" />
<ProjectReference Include="..\Modules\xIdentityService\xIdentityService.csproj" /> <ProjectReference Include="..\Modules\xIdentityService\xIdentityService.csproj" />
</ItemGroup> </ItemGroup>
<!-- IdentityServer --> <!-- IdentityServer -->
<ItemGroup> <ItemGroup>
<PackageReference Include="IdentityServer4" Version="4.1.1" /> <PackageReference Include="IdentityServer4" Version="4.1.1" />
@@ -53,10 +45,8 @@
<PackageReference Include="IdentityModel.AspNetCore.OAuth2Introspection" Version="5.0.0" /> <PackageReference Include="IdentityModel.AspNetCore.OAuth2Introspection" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.12" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.12" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.2" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.2" />
<PackageReference Include="IdentityModel.AspNetCore.AccessTokenValidation" <PackageReference Include="IdentityModel.AspNetCore.AccessTokenValidation" Version="1.0.0-preview.3" />
Version="1.0.0-preview.3" />
</ItemGroup> </ItemGroup>
<!-- Ef Core --> <!-- Ef Core -->
<ItemGroup> <ItemGroup>
<PackageReference Include="MySql.EntityFrameworkCore" Version="5.0.0" /> <PackageReference Include="MySql.EntityFrameworkCore" Version="5.0.0" />
@@ -72,16 +62,17 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<!-- For XML Documentation Support --> <!-- For XML Documentation Support -->
<PropertyGroup> <PropertyGroup>
<NoWarn>$(NoWarn);1591</NoWarn> <NoWarn>$(NoWarn);1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup> </PropertyGroup>
<!-- Create Required Folders --> <!-- Create Required Folders -->
<Target Name="CreateRequiredFolder" AfterTargets="AfterPublish"> <Target Name="CreateRequiredFolder" AfterTargets="AfterPublish">
<MakeDir Directories="$(PublishDir)wwwroot" Condition="!Exists('$(PublishDir)wwwroot')" /> <MakeDir Directories="$(PublishDir)wwwroot" Condition="!Exists('$(PublishDir)wwwroot')" />
</Target> </Target>
<ItemGroup>
<ProjectReference Include="..\Modules\xLoggingService\xLoggingService.csproj" />
</ItemGroup>
</Project> </Project>