StsGateway 1.0.5
dotnet add package StsGateway --version 1.0.5
NuGet\Install-Package StsGateway -Version 1.0.5
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="StsGateway" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StsGateway --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: StsGateway, 1.0.5"
#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.
// Install StsGateway as a Cake Addin #addin nuget:?package=StsGateway&version=1.0.5 // Install StsGateway as a Cake Tool #tool nuget:?package=StsGateway&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
StsGateway
StsGateway is a OAuth2 STS(Security Token Service) client
Package | Version | Downloads |
---|---|---|
STS Gateway |
Dependencies
.NET Standard 2.1
You can check supported frameworks here:
https://learn.microsoft.com/pt-br/dotnet/standard/net-standard?tabs=net-standard-2-1
Instalation
This package is available through Nuget Packages: https://www.nuget.org/packages/StsGateway
Nuget
Install-Package StsGateway
.NET CLI
dotnet add package StsGateway
How to use
Basic Configuration
services.AddStsGateway(config =>
{
config.ClientId = "YOUR ClIENT ID";
config.ClientSecret = "YOUR CLIENT SECRET";
config.GrantType = "GRANT TYPE EX: client_credentials";
config.RequestUri = new Uri(https://you_url);
});
With Memory Cache Configuration
services.AddMemoryCache();
services.AddStsGateway(config =>
{
config.ClientId = "YOUR ClIENT ID";
config.ClientSecret = "YOUR CLIENT SECRET";
config.GrantType = "GRANT TYPE EX: client_credentials";
config.RequestUri = new Uri(https://you_url);
config.CacheType = StsGateway.StsGatewayOptions.CacheTypeEnum.MemoryCache;
});
Usage
Example 01
var stsGateway = serviceProvider.GetService<IStsGateway>();
var accessToken = await stsGateway!.GetAccessTokenAsync();
Example 02
public class Customer()
{
private readonly IStsGateway _stsGateway;
public Customer(IStsGateway stsGateway)
{
_stsGateway = stsGateway;
}
public void SaveCustomer()
{
var accessToken = _stsGateway.GetAccessTokenAsync();
_httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
_httpClient.PostAsync(........);
}
}
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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | 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.1
- Microsoft.Extensions.Caching.Abstractions (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.Http (>= 7.0.0)
- Microsoft.Extensions.Logging (>= 7.0.0)
- Microsoft.Extensions.Options (>= 7.0.1)
- System.Text.Json (>= 7.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.