Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jzo001/forge.security.jwt.client
Jwt Token authentication / auothorization client side implementation
https://github.com/jzo001/forge.security.jwt.client
blazor jwt jwt-authentication jwt-authorization jwt-bearer-tokens jwt-client jwt-decode jwt-token sso sso-authentication sso-client sso-login wasm webassembly
Last synced: 6 days ago
JSON representation
Jwt Token authentication / auothorization client side implementation
- Host: GitHub
- URL: https://github.com/jzo001/forge.security.jwt.client
- Owner: JZO001
- License: mit
- Created: 2022-10-13T12:32:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-05T22:25:02.000Z (12 months ago)
- Last Synced: 2023-12-05T23:27:39.321Z (12 months ago)
- Topics: blazor, jwt, jwt-authentication, jwt-authorization, jwt-bearer-tokens, jwt-client, jwt-decode, jwt-token, sso, sso-authentication, sso-client, sso-login, wasm, webassembly
- Language: C#
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Forge.Security.Jwt.Client
Forge.Security.Jwt.Client is a library that provides client side authentication service for client applications.## Installing
To install the package add the following line to you csproj file replacing x.x.x with the latest version number:
```
```
You can also install via the .NET CLI with the following command:
```
dotnet add package Forge.Security.Jwt.Client
```If you're using Visual Studio you can also install via the built in NuGet package manager.
## Setup
You will need to register the authentication client services with the service collection in your _Startup.cs_ file in Blazor Server.
```c#
public void ConfigureServices(IServiceCollection services)
{
services.AddForgeJwtClientAuthenticationCore();
}
```Or in your _Program.cs_ file in Blazor WebAssembly.
```c#
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add("app");builder.Services.AddForgeJwtClientAuthenticationCore();
await builder.Build().RunAsync();
}
```### Registering services as Singleton
If you would like to register authentication client services as singletons, it is possible by using the following method:```csharp
builder.Services.AddForgeJwtClientAuthenticationCoreAsSingleton();
```This method is not recommended in the most cases, try to avoid using it.
## Usage
I have created a few examples about how to use Forge.Security.Jwt.Client in WASM / MAUI application.
Please find Forge.Yode solution in my repositories, the "Apps" namespace entries in the projects means an application type:
- ASP.NET Core Hosted
- MAUI
- WinForms
- WPFPlease also check the following projects in my repositories:
- Forge.Yoda
- Forge.Security.Jwt.Service
- Forge.Security.Jwt.Service.Storage.SqlServer
- Forge.Security.Jwt.Client
- Forge.Security.Jwt.Client.Storage.Browser
- Forge.Wasm.BrowserStorages
- Forge.Wasm.BrowserStorages.NewtonSoft.Json