TrustIdentity.ExternalProviders 1.0.2

dotnet add package TrustIdentity.ExternalProviders --version 1.0.2
                    
NuGet\Install-Package TrustIdentity.ExternalProviders -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TrustIdentity.ExternalProviders" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TrustIdentity.ExternalProviders" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="TrustIdentity.ExternalProviders" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TrustIdentity.ExternalProviders --version 1.0.2
                    
#r "nuget: TrustIdentity.ExternalProviders, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TrustIdentity.ExternalProviders@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TrustIdentity.ExternalProviders&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=TrustIdentity.ExternalProviders&version=1.0.2
                    
Install as a Cake Tool

TrustIdentity.ExternalProviders

External identity provider integration


📦 Overview

TrustIdentity.ExternalProviders enables integration with external identity providers like Azure AD, Google, Facebook, and GitHub for federated authentication.


✨ Supported Providers

  • Azure AD - Microsoft Azure Active Directory
  • Azure AD B2C - Azure AD B2C tenants
  • Google - Google authentication
  • Facebook - Facebook login
  • GitHub - GitHub authentication
  • Generic OIDC - Any OpenID Connect provider

🚀 Installation

dotnet add package TrustIdentity.ExternalProviders

🔧 Usage

Azure AD

using TrustIdentity.ExternalProviders.Extensions;

builder.Services.AddTrustIdentity(options => { ... })
    .AddExternalProvider("AzureAD", options =>
    {
        options.ClientId = "your-azure-client-id";
        options.ClientSecret = "your-azure-client-secret";
        options.TenantId = "your-tenant-id";
        options.CallbackPath = "/signin-azuread";
    });

Google

builder.Services.AddTrustIdentity(options => { ... })
    .AddExternalProvider("Google", options =>
    {
        options.ClientId = "your-google-client-id.apps.googleusercontent.com";
        options.ClientSecret = "your-google-client-secret";
        options.CallbackPath = "/signin-google";
    });

Facebook

builder.Services.AddTrustIdentity(options => { ... })
    .AddExternalProvider("Facebook", options =>
    {
        options.AppId = "your-facebook-app-id";
        options.AppSecret = "your-facebook-app-secret";
        options.CallbackPath = "/signin-facebook";
    });

GitHub

builder.Services.AddTrustIdentity(options => { ... })
    .AddExternalProvider("GitHub", options =>
    {
        options.ClientId = "your-github-client-id";
        options.ClientSecret = "your-github-client-secret";
        options.CallbackPath = "/signin-github";
    });

📋 Configuration

Azure AD B2C

builder.Services.AddExternalProvider("AzureADB2C", options =>
{
    options.Instance = "https://yourtenant.b2clogin.com";
    options.Domain = "yourtenant.onmicrosoft.com";
    options.TenantId = "your-tenant-id";
    options.ClientId = "your-client-id";
    options.ClientSecret = "your-client-secret";
    options.SignUpSignInPolicyId = "B2C_1_signupsignin";
    options.CallbackPath = "/signin-azureadb2c";
});

Generic OIDC Provider

builder.Services.AddExternalProvider("CustomOIDC", options =>
{
    options.Authority = "https://custom-idp.example.com";
    options.ClientId = "your-client-id";
    options.ClientSecret = "your-client-secret";
    options.ResponseType = "code";
    options.Scope.Add("openid");
    options.Scope.Add("profile");
    options.Scope.Add("email");
    options.CallbackPath = "/signin-custom";
});

🎯 Use Cases

Social Login

Allow users to login with their social accounts:

builder.Services.AddTrustIdentity(options => { ... })
    .AddExternalProvider("Google", googleOptions)
    .AddExternalProvider("Facebook", facebookOptions)
    .AddExternalProvider("GitHub", githubOptions);

Enterprise Federation

Integrate with corporate identity providers:

builder.Services.AddTrustIdentity(options => { ... })
    .AddExternalProvider("AzureAD", azureOptions)
    .AddExternalProvider("Okta", oktaOptions)
    .AddExternalProvider("Auth0", auth0Options);

🔧 Advanced Configuration

Claims Mapping

builder.Services.AddExternalProvider("Google", options =>
{
    options.ClientId = "...";
    options.ClientSecret = "...";
    
    // Map external claims to internal claims
    options.ClaimActions.MapJsonKey("picture", "picture");
    options.ClaimActions.MapJsonKey("locale", "locale");
    
    // Save tokens
    options.SaveTokens = true;
    
    // Additional scopes
    options.Scope.Add("https://www.googleapis.com/auth/userinfo.profile");
});

Custom Events

builder.Services.AddExternalProvider("AzureAD", options =>
{
    options.Events = new OAuthEvents
    {
        OnCreatingTicket = async context =>
        {
            // Custom logic after successful authentication
            var email = context.Principal.FindFirst(ClaimTypes.Email)?.Value;
            await CreateOrUpdateUserAsync(email);
        },
        
        OnRemoteFailure = async context =>
        {
            // Handle authentication failures
            await LogFailureAsync(context.Failure);
        }
    };
});

📊 Provider Setup Guides

Google Setup

  1. Go to Google Cloud Console
  2. Create a new project
  3. Enable Google+ API
  4. Create OAuth 2.0 credentials
  5. Add authorized redirect URI: https://yourdomain.com/signin-google
  6. Copy Client ID and Client Secret

Azure AD Setup

  1. Go to Azure Portal
  2. Navigate to Azure Active Directory
  3. Go to App registrations → New registration
  4. Add redirect URI: https://yourdomain.com/signin-azuread
  5. Create a client secret
  6. Copy Application (client) ID, Directory (tenant) ID, and client secret

Facebook Setup

  1. Go to Facebook Developers
  2. Create a new app
  3. Add Facebook Login product
  4. Configure OAuth redirect URI: https://yourdomain.com/signin-facebook
  5. Copy App ID and App Secret

GitHub Setup

  1. Go to GitHub Settings
  2. Create a new OAuth App
  3. Set Authorization callback URL: https://yourdomain.com/signin-github
  4. Copy Client ID and Client Secret

🏗️ Architecture

TrustIdentity.ExternalProviders/
├── Providers/         # Provider implementations
│   ├── AzureADProvider.cs
│   ├── GoogleProvider.cs
│   ├── FacebookProvider.cs
│   └── GitHubProvider.cs
├── Extensions/       # Configuration extensions
└── Models/          # Provider models

📚 Documentation


📄 License

Apache 2.0 - See LICENSE

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TrustIdentity.ExternalProviders:

Package Downloads
TrustIdentity.Server

Complete Enterprise IAM Server - OAuth 2.0, OIDC, SAML, WS-Fed

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 99 2/5/2026
1.0.1 102 2/4/2026
1.0.0 104 1/22/2026

- Full implementation of OAuth 2.0 and OpenID Connect 1.0.
     - Integrated SAML 2.0 and WS-Federation support.
     - Advanced AI/ML-driven fraud detection and behavioral analysis.
     - FAPI 1.0 & 2.0 (Security Profile) compliance.
     - Support for PKCE, DPoP, Mutual TLS, PAR, and JAR.
     - Entity Framework Core support for SQL Server, PostgreSQL, MySQL, and SQLite.
     - Multi-tenant isolation and Backend-for-Frontend (BFF) patterns.
     - Complete Admin UI and REST API for identity management.