Skip to content
Dashboard
Theme
Theme

.NET SDK

The OhAuthCat server SDK for .NET 8 and .NET 10.

View Markdown

.NET 8 or .NET 10, base class library only.

dotnet add package OhAuthCat --version 0.0.2
  • Create a client: new OhAuthCatClient(new OhAuthCatOptions { ApiKey = ..., ClientId = "pk_..." }). It is disposable.
  • Call any API operation, for example await client.Organizations.GetOrganizationAsync("org_..."), or await foreach over ListDirectoryUsersAutoPagingAsync(...).
  • SSO: client.SsoHelpers.GetAuthorizationUrl(new AuthorizationOptions { RedirectUri = ..., Domain = ... }) returns Url and CodeVerifier; then await client.SsoHelpers.GetProfileAndTokenAsync(code, verifier, redirectUri).
  • Webhooks: Webhooks.Verify(rawBody, request.Headers["OhAuthCat-Signature"], secret).
  • Errors are OhAuthCatException subclasses, such as NotFoundException and RateLimitedException, with the stable Code.
  • Set your own idempotency key with RequestOptions.IdempotencyKey.