Support

Ask questions on Stack Overflow.

Email support@foxids.com with a link to your question.

Package

Releases
NuGet ITfoxtec Identity

Code and license

GitHub code
Open-source license

ITfoxtec Identity

ITfoxtec Identity is an open-source .NET library that implements OAuth 2.0 and OpenID Connect 1.0.

The company name ITfoxtec has changed to FoxIDs but the components will keep the ITfoxtec name as part of the component name for now.

Supported .NET versions:

  • .NET 10.0
  • .NET 9.0
  • .NET 8.0
  • .NET 7.0
  • .NET 6.0
  • .NET Standard 2.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).

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());

Your Privacy

We use cookies to make your experience of our websites better. Click the 'Accept all cookies' button to agree to the use of cookies. To opt out of non-essential cookies, click 'Necessary cookies only'.

Visit our Privacy Policy page for more