Skip to main content

.NET SDK

We offer a .NET SDK for interacting with the Permissions API.

Server SDK

The Server SDK is designed for use in server-side applications like ASP.NET. It can be used to propagate Resource changes from your system to the Permissions API and to check permissions for your actions.

Installation

Add the Permissions Server SDK NuGet package to your project.

dotnet add package SpaceBlocks.Permissions.Server

Initialization

Before using the Server SDK, we need to create a Client in the Developer Portal with at least the following scopes:

  • core:permissions:config:read
  • core:permissions:config:write

This will give us a Client ID and Client Secret that we can use to authenticate with the API.

Instantiate the SDK with the API URL and API Key from the Developer Portal.

var auth = new AuthenticationOptions(
"<YOUR_CLIENT_ID>",
"<YOUR_CLIENT_SECRET>",
"core:permissions:config:read core:permissions:config:write");

var client = new PermissionsClient(new Uri("<YOUR_PERMISSIONS_URL>"), "<API_KEY>", auth);