Install Auth SDK

Learn how to configure the Wristband SDK for you ASP.NET application.

Installation

Install the Wristband Auth SDK from the NuGet repository:

dotnet add package Wristband.AspNet.Auth
NuGet\Install-Package Wristband.AspNet.Auth

Configuration

Prerequisites

Before you can configure the SDK, you'll need to make sure you have the following values:

  • WRISTBAND_APPLICATION_VANITY_DOMAIN
  • WRISTBAND_CLIENT_ID
  • WRISTBAND_CLIENT_SECRET

If you went through the Set Up a Wristband Application guide, you should have been presented with these three values after the application was provisioned. If you don't have the above values on hand, you can retrieve them from the Wristband dashboard by following the steps in this guide.

Configure The SDK

Register the SDK's WristbandAuthenticationService in your Program.cs file. Update the AuthConfig options with the values for your application.

// Program.cs

using Wristband.AspNet.Auth;

var builder = WebApplication.CreateBuilder(args);

// Register Wristband authentication configuration.
builder.Services.AddWristbandAuth(options =>
{
  options.ClientId = "<WRISTBAND_CLIENT_ID>";
  options.ClientSecret = "<WRISTBAND_CLIENT_SECRET>";
  options.WristbandApplicationVanityDomain = "<WRISTBAND_APPLICATION_VANITY_DOMAIN>";
});

//
// Other middleware and routes...
//

...

What’s Next

Next, you'll use the Wristband SDK to create the necessary authentication endpoints in your C# server.