VOOZH about

URL: https://www.nuget.org/packages/Ars.Common.IdentityServer4/

⇱ NuGet Gallery | Ars.Common.IdentityServer4 8.0.0




👁 Image
Ars.Common.IdentityServer4 8.0.0

dotnet add package Ars.Common.IdentityServer4 --version 8.0.0
 
 
NuGet\Install-Package Ars.Common.IdentityServer4 -Version 8.0.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ars.Common.IdentityServer4" Version="8.0.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ars.Common.IdentityServer4" Version="8.0.0" />
 
Directory.Packages.props
<PackageReference Include="Ars.Common.IdentityServer4" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ars.Common.IdentityServer4 --version 8.0.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Ars.Common.IdentityServer4, 8.0.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ars.Common.IdentityServer4@8.0.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ars.Common.IdentityServer4&version=8.0.0
 
Install as a Cake Addin
#tool nuget:?package=Ars.Common.IdentityServer4&version=8.0.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

<p align="center"> <img height="140" src="https://github.com/aabb1212/Ars/blob/master/logo.png"> </p>

Ars

👁 NuGet

a simple .net6 webapi framework with some extensions.
include autofac,consul,grpc,efcore,identityserver4,redis,signalr,localization,skyapm,upload and download excel,
cap,ocelot,webapiclientcore extensions. and some samples with them.

Getting Started

NuGet

ars can be installed in your project with the following command.

PM> Install-Package Ars.Common.Host

ars supports some extensions, following packages are available to install:

PM> Install-Package Ars.Common.IdentityServer4
PM> Install-Package Ars.Common.Consul
PM> Install-Package Ars.Common.EFCore
PM> Install-Package Ars.Common.Redis
PM> Install-Package Ars.Common.SignalR
PM> Install-Package Ars.Common.SkyWalking
PM> Install-Package Ars.Common.Cap
PM> Install-Package Ars.Common.Ocelot
PM> Install-Package Ars.Common.RpcClientCore

Configuration

add Service:
var builder = WebApplication.CreateBuilder(args);
builder.Services
 //add ars core service
 .AddArserviceCore(builder, config =>
 {
 //add consul client service
 config.AddArsConsulDiscoverClient();
	 
 //add consul register service
 config.AddArsConsulRegisterServer();

 //add identity resource service
 config.AddArsIdentityClient();
	 
 //add identity server service
 config.AddArsIdentityServer();

 //add redis service
 config.AddArsRedis();

 //add localization service
 config.AddArsLocalization();

 //add signalr service
 config.AddArsSignalR(config =>
 {
		config.CacheType = 0;
		config.UseMessagePackProtocol = true;
 });

	//add skyapm service
	config.AddArsSkyApm();

	//add cap service
	config.AddArsCap(option => 
	{
		option.UseEntityFramework<xxxDbContext>();
		option.UseRabbitMQ(mq => 
		{
			mq.HostName = "localhost";
			mq.UserName = "guest";
			mq.Password = "guest";
		});
	});

	//add ocelot service
	//example service -> sample/main/ArsApiGateway
	config.AddArsOcelot(option => 
	{
		//如果下游协议是https则添加下面代码
		//option.AddDelegatingHandler<X509CertificateDelegatingHandler>();
	});

	//add webapiclientcore service
	config.AddArsHttpApi<IWeatherForecastHttpApi>(option =>
	{
		//采用ars默认的httpclient
		option.UseArsHttpClient = true;
		//采用ars默认的HttpsMessageHandler
		option.UseHttps = true;
		//采用ars默认的策略
		option.UseHttpClientCustomPolicy = true;
	});
	config.AddArsHttpApi<IDbHttpApi>(configureBuilder:builder => 
	{
		//可添加自定义策略
		builder.AddArsTransientHttpErrorPolicy();
		//可添加自定义HttpsMessageHandler
		builder.ConfigureArsPrimaryHttpsMessageHandler();
	});
})

//add dbcontext service
.AddArsDbContext<xxxDbContext>()

//add exportexcel service
.AddArsExportExcelService(typeof(Program).Assembly)

//add uploadexcel service
.AddArsUploadExcelService(option =>
{
	option.UploadRoot = "wwwroot/upload";
	option.RequestPath = "apps/upload";
	option.SlidingExpireTime = TimeSpan.FromDays(1);
});
use Application:
 var app = builder.Build();
 
 //ars exception middleware
 app.UsArsExceptionMiddleware();

	.....

 //use ars core application
 app.UseArsCore() 
 //use uploadexcel application
 .UseArsUploadExcel();
change your appsettings.Development.json
	{
	 "Logging": {
		"LogLevel": {
		 "Default": "Information",
		 "Microsoft.AspNetCore": "Warning"
		}
	 },
	 //consul client config
	 "ConsulDiscoverConfiguration": {
		"ConsulDiscovers": [
		 {
			"ConsulAddress": "http://ip:port",
			"ServiceName": "apigrpc",
			"Communication":{
			 "CommunicationWay":0,
				"GrpcUseHttp1Protocol": true,
				"UseHttps": true,
				"UseIdentityServer4Valid": true,
				"IdentityServer4Address": "http://ip:port",
				"ClientId": "grpc-key",
				"ClientSecret": "grpc-secret",
				"Scope": "grpcapi-scope",
				"GrantType": "client_credentials"
			}
		 }
		]
	 },
	 
	 //consul register config
	 "ConsulRegisterConfiguration": {
		"ConsulAddress": "http://ip:port",
		"ServiceName": "apigrpc",
		"UseHttps": true,
	 },
	 
	 //resource server identity config
	 "ArsIdentityClientConfiguration": {
		"Authority": "http://ip:port",
		"ApiName": "apiIds4Second", 
		"RequireHttpsMetadata": true,
	 },
	 
	 //identity server config
	 "ArsIdentityServerConfiguration": {
		"ArsApiResources": [
		 {
			"Name": "apiIds4First",
			"DisplayName": "my default grpcapi",
			"UserClaims": [
			 "http://schemas.microsoft.com/ws/2008/06/identity/claims/role",
			 "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
			 "tenant",
			 "sub"
			],
			"Scopes": [
			 "grpcapi-scope"
			]
		 },
		 {
			"Name": "apiIds4Second",
			"DisplayName": "my default pckeapi",
			"UserClaims": [
			 "http://schemas.microsoft.com/ws/2008/06/identity/claims/role",
			 "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
			 "tenant",
			 "sub"
			],
			"Scopes": [
			 "ids4-scope",
			 "openid",
			 "profile"
			]
		 }
		],
		"ArsClients": [
		 {
			"AppKey": "grpc-key",
			"AppSecret": "grpc-secret",
			"AccessTokenLifetime": 3600,
			"AllowedScopes": [ "grpcapi-scope" ],
			"GrantType": [ "client_credentials", "password" ],
			"AllowedCorsOrigins": [ "http://ip:port" ]
		 },
		 {
			"AppKey": "pcke-key",
			"AppSecret": "pcke-secret",
			"AccessTokenLifetime": 3600,
			"AllowedScopes": [ "openid", "profile", "ids4-scope" ],
			"GrantType": [ "authorization_code" ],
			"RedirectUris": [ "http://ip:port/signin-oidc" ],
			"PostLogoutRedirectUris": [ "http://ip:port/signout-callback-oidc" ]
		 }
		],
		"ArsApiScopes": [
		 "grpcapi-scope",
		 "ids4-scope",
		 "openid",
		 "profile"
		],
	 },
	 
	 //redis config
	 "ArsCacheConfiguration": {
		"RedisConnection": "ip",
		"DefaultDB": 1
	 },

	 //localization config
	 "ArsLocalizationConfiguration": {
		"ResourcesPath": "Resources",
		"IsAddViewLocalization": true,
		"IsAddDataAnnotationsLocalization": true,
		"Cultures": [
		 "en-GB",
		 "en",
		 "fr-FR",
		 "fr",
		 "en-US",
		 "zh-Hans"
		],
		"DefaultRequestCulture": "en-US"
	 },
	 
	 //DbContext config
	 "ArsDbContextConfiguration": {
		//1 mysql;2 mssql
		"DbType": 2,
		//Database address
		"DefaultString": "Data Source=xxxxx; Initial Catalog=xxxxx;user id=xxxxx;pwd=xxxxx"
	 },

	 //Basic config
	 "ArsBasicConfiguration": {
		 "ServiceIp": "192.168.110.65",
		 "ServicePort": 5105,
		 "CertificatePath": "Certificates//IS4.pfx",
		 "CertificatePassWord": "aabb1212",
		 "UseHttps": true
	 }
	}

License

MIT

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.0 257 10/29/2025
2.0.1 245 10/22/2025
1.9.2 303 5/26/2025
1.9.0 377 12/15/2023
1.8.0 263 12/7/2023
1.7.3 322 10/19/2023
1.7.0 319 8/3/2023
1.6.2 377 5/31/2023
1.6.1 345 5/19/2023
1.5.3 373 5/11/2023
1.5.2 391 4/4/2023
1.5.1 444 3/24/2023
1.4.0 459 3/6/2023
1.3.0 467 2/10/2023
1.2.0 563 2/9/2023