Two Factor Authenticator App in WPF

C# WPF Two Factor Authenticator App in WPF

There are a lot of 2 factor authenticaton apps out there for mobile phones like those of Microsoft, Google or Fortinet.
I wanted a basic, easy to use app for Windows so I can use both my mobile phone or Windows to get the token for 2 factor logins.

Beacuse security is important and I am neither a security expert nor a professional WPF developer I decided to put the full source code on GitHub so everyone can take a look at the code, fork it and improve for their own usage.

App key features

  • Encypted settings file with all the logins.
  • Scan a QR code directly from the desktop or add it from the disk as an image file.
  • Keeps track of how many times a token is used and can sort by most used.
  • Can ask for a password on opening the app for extra security if needed.
  • Create a backup of your logins.
  • Save a copy of the scanned barcode so you can share it with another device or person.
  • Has a Dark Mode color scheme.
View source on GitHub

You can also download the app here as a stand-alone executable.
Download the App

Test your 2 Factor App

Scan the QR code in your Factor app. It will give you a name that looks like this:
VDWWD TestLogin 2598
Then input the 6 digit code the app generates and check if it is correct.

Quick Start Guide

First time use

First time use
When you open the app for the first time it will ask for a password. This password is stored in the Windows Credentials Manager. This password will be used to encrypt the logins.
If you backup and restore the TwoFactor.settings file to another device and you use the same password, then you have the same logins available there also.

The main window

The main window
To add a login you can either scan the desktop for a QR code.

Or open a QR code image from the disk.

Edit a login

Edit a login
You can edit a login by clicking the > next to the name. There you can change the name or delete the login.
If you enabled saving the QR code in the settings, it wil be displayed here so you can scan it with a phone or download an image by clicking it.

Sort order
Change the sort order of the logins. By default it will be by "most used".

Save QR code image
If you enable this option then an image of the QR code will be stored in the app folder. You can then use this QR code on another device. It will also be shown in the "Edit login" window.
This is a potential security risk!

Ask password on open
When opening the app it will ask you for your password for extra security.

With the "Export" button you create a Zip file with the settings file and the stored QR codes if there are any. This can be used as a backup or can be copied to another computer, extracted it the app folder to use the logins there (if the same password is used).