Coder Social home page Coder Social logo

twofactorauthdirectory's Introduction

TwoFactorAuthDirectory (related to 2fa.directory)

NuGet Releases NuGet Releases Issues GitHub Donate GitHub Sponsors

KeeOtp2 is a simple NuGet package to determine which website supports which type of 2fa. Therefore it uses the twofactorauth API, which is provided by GitHub user 2factorauth. (They also have a frontend application, which you can find here.)

Installation

This guide is for Visual Studio only

  • Right-click on your project in the Solution Explorer
  • Select Manage NuGet Packages
  • Click Browse and search for TwoFactorAuthDirectory
  • Select the one by tiuub and install it

Usage

Fetching websites from API

...

TwoFactorAuthClient client = new TwoFactorAuthClient();

// Setting a custom API url (optional)
client.ApiUrl = "https://twofactorauth.tiuub.de/frozen/2022-07-06/api/v3/all.json";

// Fetching websites from API asynchronously
List<Website> websites = client.FetchAsync().Result;

// Fetching websites from API synchronously
List<Website> websites = client.Fetch();

...

Sorting

...

TwoFactorAuthClient client = new TwoFactorAuthClient();
List<Website> websites = client.Fetch();

// Find all websites which are supporting anything
List<Website> websitesByName = websites.FindAll(website => website.IsSupportingAny());

// Find all websites which are supporting TfyTypes.Totp or TfaTypes.Sms
List<Website> websitesByName = websites.FindAll(website => website.IsSupporting(TfaTypes.Totp | TfaTypes.Sms));

// Find all websites which include "Google" in their name
List<Website> websitesByName = websites.FindByName("Google", ignoreCase: true);

// Find all websites which have the exact domain "mail.google.com"
List<Website> websitesByDomain = websites.FindByDomain("mail.google.com");

// Find all websites which have parts of the given url in their url field or in their additional_domains/domain field
List<Website> websitesByUrl = websites.FindByUrl("https://log:[email protected]/test-path?test-parameter:123");

// Find all websites which supports a specific type of tfa
List<Website> websitesByTfa = websites.FindByTfa(TfaTypes.Totp | TfaTypes.Sms);

// Find all websites which are subjected by specific keywords
List<Website> websitesByKeywords = websites.FindByKeywords(new List<String>() { "email", "security" });

// Find all websites which are subjected by specific regions
List<Website> websitesByRegions = websites.FindByRegions(new List<String>() { "us", "de" });

...

License

GitHub

Dependencies

Dependencie Source NuGet Author License
Newtonsoft.Json source NuGet newtonsoft MIT
Microsoft.Net.Http Project website NuGet Microsoft, dotnetframework License
Microsoft.Bcl.Async Project website NuGet Microsoft, dotnetframework License

Dependencies (TwoFactorAuthDirectoryTests)

Dependencie Source NuGet Author License
coverlet.collector source NuGet tonerdo MIT
Microsoft.NET.Test.Sdk source NuGet Microsoft MIT
MSTest.TestAdapter source NuGet Microsoft MIT
MSTest.TestFramework source NuGet Microsoft MIT

twofactorauthdirectory's People

Contributors

tiuub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.