Skip to content

Instantly share code, notes, and snippets.

@juucustodio
Last active October 8, 2018 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juucustodio/e4508a7407deeb61608b8388258c1c13 to your computer and use it in GitHub Desktop.
Save juucustodio/e4508a7407deeb61608b8388258c1c13 to your computer and use it in GitHub Desktop.
Example how to implement a token generator in Xamarin.Forms Applications. - http://julianocustodio.com/token
using OtpSharp;
using System.Threading;
using Xamarin.Forms;
namespace DemoToken
{
public partial class MainPage : ContentPage
{
public string Codigo
{
get => _codigo;
set
{
_codigo = value;
OnPropertyChanged();
}
}
private string _codigo;
public string Segundos
{
get => _segundos;
set
{
_segundos = value;
OnPropertyChanged();
}
}
private string _segundos;
private readonly byte[] secretKey;
private Totp totp;
private Timer timer;
public MainPage()
{
InitializeComponent();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment