Authware.AspNetCore
1.0.5
dotnet add package Authware.AspNetCore --version 1.0.5
NuGet\Install-Package Authware.AspNetCore -Version 1.0.5
<PackageReference Include="Authware.AspNetCore" Version="1.0.5" />
paket add Authware.AspNetCore --version 1.0.5
#r "nuget: Authware.AspNetCore, 1.0.5"
// Install Authware.AspNetCore as a Cake Addin #addin nuget:?package=Authware.AspNetCore&version=1.0.5 // Install Authware.AspNetCore as a Cake Tool #tool nuget:?package=Authware.AspNetCore&version=1.0.5
<p align="center"> <img src="https://raw.githubusercontent.com/AuthwareCloud/dotnet-sdk/master/authware-s.png" width="75" height="75"> <h1 align="center">Authware ASP.NET Core SDK</h1> <p align="center">Wrapper for Authware for ASP.NET Core & Blazor (.NET standard 2.1)</p> <p align="center"> <a href="https://docs.authware.org">View our documentation</a> </p> </p>
📲 Installation
Run this in your package manager console:
PM> Install-Package Authware.AspNetCore
👩💻 Usage
Usage of this library is easy as pie, it follows the exact same principal of the original .NET SDK, the only difference is how you initialize it
Firstly, you'll need to add it to your service collection, along with the HttpClientFactory dependency
services.AddHttpClient();
services.AddAuthware(options => {
options.AppId = "Your app ID goes here";
});
Then you're done, you can access the library via the AuthwareApplication
class, which has been injected into your services.
Here's an example of how you can access it in a Web API context
private readonly AuthwareApplication _authware;
public MyController(AuthwareApplication authware)
{
_authware = authware;
}
[Route("/auth")]
[HttpGet]
public async Task<IActionResult> AuthAsync([FromBody] LoginForm ctx)
{
try
{
var (token, profile) = await _authware.LoginAsync(ctx.Username, ctx.Password);
return Ok(new
{
error = false,
token = token.AuthToken,
username = profile.Username,
email = profile.Email
});
}
catch (AuthwareException ex)
{
return BadRequest(new
{
error = true,
message = ex.Message
});
}
}
🖥️ Compilation
In-order for compilation of the library, you must have the following:
- .NET SDK 5.0+
Note: Compilation with .NET 5.0+ is required for the instructions noted here.
- Clone the repository
git clone https://github.com/AuthwareCloud/aspnetcore-sdk.git && cd dotnet-sdk
- Tell
dotnet
to compile the library
dotnet build
- All done! Navigate to the bin/Release or bin/Debug folder to find the
.nupkg
or.dll
file.
📜 License
Licensed under the MIT license, see LICENSE.MD
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. |
-
.NETStandard 2.1
- Microsoft.Extensions.Http (>= 6.0.0)
- System.Text.Json (>= 6.0.2)
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 |
---|
Fix authorization bugs