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
<PackageReference Include="Nedo.AspNet.Authentication.MaxMind" Version="2.0.9" />
<PackageVersion Include="Nedo.AspNet.Authentication.MaxMind" Version="2.0.9" />
<PackageReference Include="Nedo.AspNet.Authentication.MaxMind" />
paket add Nedo.AspNet.Authentication.MaxMind --version 2.0.9
#r "nuget: Nedo.AspNet.Authentication.MaxMind, 2.0.9"
#:package Nedo.AspNet.Authentication.MaxMind@2.0.9
#addin nuget:?package=Nedo.AspNet.Authentication.MaxMind&version=2.0.9
#tool nuget:?package=Nedo.AspNet.Authentication.MaxMind&version=2.0.9
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.
- Sign up at https://www.maxmind.com/en/geolite2/signup.
- Download
GeoLite2-City.mmdbfrom your account dashboard. - Place the file somewhere your service can read on startup (e.g.
./data/GeoLite2-City.mmdb). - 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 (honorsX-Forwarded-Forfirst hop).ClientLocation— the resolved label, e.g."Jakarta, ID".nullfor private / loopback / unparseable IPs and when the database has no row.
Both columns are exposed on the GET /account/sessions response.
Notes
- The
.mmdbreader 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
IIpGeolocatordirectly and register it asIIpGeolocatorin DI — this package is just one possible implementation.
| Product | Versions 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. |
-
net9.0
- MaxMind.GeoIP2 (>= 5.3.0)
- Nedo.AspNet.Authentication.Local (>= 2.0.9)
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 |