Nedo.AspNet.Authentication.MaxMind 2.0.9

dotnet add package Nedo.AspNet.Authentication.MaxMind --version 2.0.9
                    
NuGet\Install-Package Nedo.AspNet.Authentication.MaxMind -Version 2.0.9
                    
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="Nedo.AspNet.Authentication.MaxMind" Version="2.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nedo.AspNet.Authentication.MaxMind" Version="2.0.9" />
                    
Directory.Packages.props
<PackageReference Include="Nedo.AspNet.Authentication.MaxMind" />
                    
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 Nedo.AspNet.Authentication.MaxMind --version 2.0.9
                    
#r "nuget: Nedo.AspNet.Authentication.MaxMind, 2.0.9"
                    
#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 Nedo.AspNet.Authentication.MaxMind@2.0.9
                    
#: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=Nedo.AspNet.Authentication.MaxMind&version=2.0.9
                    
Install as a Cake Addin
#tool nuget:?package=Nedo.AspNet.Authentication.MaxMind&version=2.0.9
                    
Install as a Cake Tool

Nedo.AspNet.Authentication.MaxMind

MaxMind GeoLite2-City IP geolocation provider for Nedo.AspNet.Authentication. Resolves a session's client IP into a "City, CC" label that the account-settings Sessions list renders next to each device row.

Install

dotnet add package Nedo.AspNet.Authentication.MaxMind

Database

GeoLite2-City is a free MaxMind product but requires a no-cost account.

  1. Sign up at https://www.maxmind.com/en/geolite2/signup.
  2. Download GeoLite2-City.mmdb from your account dashboard.
  3. Place the file somewhere your service can read on startup (e.g. ./data/GeoLite2-City.mmdb).
  4. Refresh it periodically — MaxMind updates the database weekly.

Wire-up

builder.Services.AddMaxMindGeoLite2(opt =>
{
    opt.DatabasePath = "./data/GeoLite2-City.mmdb";
    opt.Locale = "en"; // optional — preferred city-name language
});

The SessionTokenIssuer constructor accepts IIpGeolocator?, so as soon as one is registered the issuer starts populating RefreshTokens.ClientLocation on every new + rotated session. Existing sessions stay null until they rotate.

What gets stored

  • ClientIp — the IP the API extracted (honors X-Forwarded-For first hop).
  • ClientLocation — the resolved label, e.g. "Jakarta, ID". null for private / loopback / unparseable IPs and when the database has no row.

Both columns are exposed on the GET /account/sessions response.

Notes

  • The .mmdb reader is opened once at startup as a singleton — it's a thread-safe memory-mapped reader.
  • Lookup failures and missing-row errors are swallowed and return null. The library never blocks a sign-in because geolocation failed.
  • Private + loopback IPs short-circuit before the database call.
  • For non-MaxMind sources (an HTTP service, an in-memory map, your own database), implement IIpGeolocator directly and register it as IIpGeolocator in DI — this package is just one possible implementation.
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.9 122 5/11/2026