Passage.NET
1.1.0
See the version list below for details.
dotnet add package Passage.NET --version 1.1.0
NuGet\Install-Package Passage.NET -Version 1.1.0
<PackageReference Include="Passage.NET" Version="1.1.0" />
paket add Passage.NET --version 1.1.0
#r "nuget: Passage.NET, 1.1.0"
// Install Passage.NET as a Cake Addin #addin nuget:?package=Passage.NET&version=1.1.0 // Install Passage.NET as a Cake Tool #tool nuget:?package=Passage.NET&version=1.1.0
<img src="https://storage.googleapis.com/passage-docs/passage-logo-gradient.svg" alt="Passage logo" style="width:250px;"/>
Passage.NET
This dotnet SDK allows for verification of server-side authentication for applications using Passage
💾 Installation
Install this package using nuget.
dotnet add pacakge Passage.NET
💉 Dependency injection
If you want to integrate with HttpClientFactory and Microsoft.Extensions.DependencyInjection
dotnet add pacakge Passage.Net.Extensions.DependencyInjection
Usage:
//...
builder.Services.AddPassage(options =>
{
options.AppId = "YOUR_APP_ID";
options.ApiKey = "YOUR_API_KEY";
});
//...
var app = builder.Build();
//...
app.MapGet("/getapp", async (IPassage passage) =>
{
var appinfo = await passage.GetApp();
return appinfo;
})
📒 Usage
Validate JWT
You need to provide Passage with your App ID in order to verify the JWTs.
var config = new PassageConfig()
{
AppId = "YOUR_APP_ID"
}
var passage = new Passage(config);
var subject = await passage.ValidateToken("JWT_TO_VALIDATE");
Retrieve App Info
To retrieve information about an app, you should use the passage.GetApp() function.
var config = new PassageConfig()
{
AppId = "YOUR_APP_ID",
ApiKey = "YOUR_API_KEY"
}
var passage = new Passage(config);
var passageApp = await passage.GetApp();
Retrieve User Information By Identifier
To retrieve information about a user, you should use the passage.GetUserByIdentifier("your@email.cc") function.
var config = new PassageConfig()
{
AppId = "YOUR_APP_ID",
ApiKey = "YOUR_API_KEY"
}
var passage = new Passage(config);
var passageUser = await passage.GetUserByIdentifier("user@email.cc");
Retrieve User Information By User Id
To retrieve information about a user, you should use the passage.GetUser("USER_ID") function.
var config = new PassageConfig()
{
AppId = "YOUR_APP_ID",
ApiKey = "YOUR_API_KEY"
}
var passage = new Passage(config);
var passageUser = await passage.GetUser("USER_ID");
Create a User
You can also create a Passage user by providing an email or phone (phone number must be a valid E164 phone number).
var config = new PassageConfig()
{
AppId = "YOUR_APP_ID",
ApiKey = "YOUR_API_KEY"
}
var passage = new Passage(config);
var createRequest = new CreateUserRequest()
{
Email = "user@email.cc",
//note that user_metadata is an optional field and is defined in your Passage App settings (Registration Fields).
User_metadata = new
{
example = 123
}
};
var passageUser = await passage.CreateUser(createRequest);
Update a User
You can update a user attributes
var config = new PassageConfig()
{
AppId = "YOUR_APP_ID",
ApiKey = "YOUR_API_KEY"
}
var passage = new Passage(config);
var updateRequest = new UpdateUserRequest()
{
Email = "user@email.cc",
//note that user_metadata is an optional field and is defined in your Passage App settings (Registration Fields).
User_metadata = new
{
example = 1234
}
};
var passageUser = await passage.UpdateUser("USER_ID",updateRequest);
Delete a User
To delete a Passage user, you will need to provide the userID, and corresponding app credentials.
var config = new PassageConfig()
{
AppId = "YOUR_APP_ID",
ApiKey = "YOUR_API_KEY"
}
var passage = new Passage(config);
await passage.DeleteUser("USER_ID");
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.IdentityModel.Tokens (>= 7.5.0)
- Newtonsoft.Json (>= 13.0.3)
- System.IdentityModel.Tokens.Jwt (>= 7.5.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Passage.NET:
Package | Downloads |
---|---|
Passage.Net.Extensions.DependencyInjection
integrate Passage with HttpClientFactory and Microsoft.Extensions.DependencyInjection |
GitHub repositories
This package is not used by any popular GitHub repositories.