OAuth2NetCore.Redis
2.0.0
dotnet add package OAuth2NetCore.Redis --version 2.0.0
NuGet\Install-Package OAuth2NetCore.Redis -Version 2.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="OAuth2NetCore.Redis" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OAuth2NetCore.Redis" Version="2.0.0" />
<PackageReference Include="OAuth2NetCore.Redis" />
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 OAuth2NetCore.Redis --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OAuth2NetCore.Redis, 2.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 OAuth2NetCore.Redis@2.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=OAuth2NetCore.Redis&version=2.0.0
#tool nuget:?package=OAuth2NetCore.Redis&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
OAuth2NetCore.Redis
OAuth2NetCore 的 Redis 后端实现,基于 StackExchange.Redis。netstandard2.0 目标。
提供的实现
RedisClientStore— 实现IClientStore,将客户端定义存于 Redis hash;可配合ISecretEncryptor对 client secret 字段加密。RedisRefreshTokenInfoStore— 实现IRefreshTokenInfoStore,refresh token 与 token info JSON 加密存储;取-删原子(v2.0 起使用 RedisGETDEL)。RedisStateStore— 实现IStateStore,state / endSessionID 短期存储;取-删原子(v2.0 起使用 RedisGETDEL)。
服务端要求
- Redis ≥ 6.2.0(v2.0 起使用
GETDEL命令)。
用法
services.AddOAuth2AuthServer(options => {
var encryptor = new X509SecretEncryptor(cert); // OAEP-SHA256
options.ClientStoreFactory = _ => new RedisClientStore(redisConnStr, "ec:CLIENTS", secretEncryptor: encryptor);
options.RefreshTokenInfoStore = _ => new RedisRefreshTokenInfoStore(redisConnStr, secretEncryptor: encryptor);
options.StateStoreFactory = _ => new RedisStateStore(redisConnStr, prefix: "st:");
// ...
});
v2.0 注意
- v2.0 起 RSA padding 切换到 OAEP-SHA256(v1.x 是 PKCS#1 v1.5)。已存的加密 client secret 需要先用 v1.x 解密、再用 v2.0 加密回去。详见 UPGRADING-v2.md。
- v2.0 起
GetThenRemove*方法改用原子GETDEL,消除 refresh token 重放窗口;要求 Redis 服务端 ≥ 6.2.0。
仓库
https://github.com/Lukiya/oauth2net
协议
GPL-3.0-or-later
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Duende.IdentityModel (>= 8.1.0)
- OAuth2NetCore (>= 2.0.0)
- StackExchange.Redis (>= 2.13.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on OAuth2NetCore.Redis:
| Package | Downloads |
|---|---|
|
SyncSoft.ECP.Hosting
An app framework for SyncSoft Inc. |
|
|
SyncSoft.App.ECPHost
An app framework for SyncSoft Inc. |
GitHub repositories
This package is not used by any popular GitHub repositories.