ITfoxtec Identity
ITfoxtec Identity is an open-source .NET library that implements OAuth 2.0 and OpenID Connect 1.0.
The library includes request and response models for OAuth 2.0 and OpenID Connect, validation helpers, and utilities for building authorization, token, and logout flows.
Built-in OIDC discovery helpers make it easy to cache discovery documents and JSON Web Key Sets (JWKS).
When FoxIDs is relevant
Use the open-source library when you need OAuth 2.0 and OpenID Connect building blocks in your own .NET code. FoxIDs is relevant when you need a complete hosted identity platform with login flows, federation, multi-tenant setup, and operational support.
- Move from protocol building blocks to a full identity service
- Add federation, external identity providers, and tenant-specific login flows
- Get hosted operations, compliance features, and expert support
You can use the JWT tool to decode tokens and create self-signed certificates with the certificate tool.
Code
The code below shows how to build an OAuth 2.0 authorization URL using OIDC discovery.
using ITfoxtec.Identity;
using ITfoxtec.Identity.Discovery;
using ITfoxtec.Identity.Messages;
var discoveryHandler = new OidcDiscoveryHandler(httpClientFactory);
var discovery = await discoveryHandler.GetOidcDiscoveryAsync("https://login.example.com/.well-known/openid-configuration");
var request = new AuthorizationRequest
{
ResponseType = "code",
ClientId = clientId,
RedirectUri = redirectUri,
Scope = new[] { "openid", "profile" }.ToSpaceList(),
State = Guid.NewGuid().ToString("N")
};
var authorizeUrl = discovery.AuthorizationEndpoint.AddQuery(request.ToDictionary());