This library is no longer actively maintained. Please visit the Twilio Docs for Authy / .NET usage documentation or consider using Twilio Verify with Twilio's .NET helper library for your SMS verification needs.
Forked and patched from the library of devinmartin in https://bitbucket.org/devinmartin/authy.net/wiki/Home
Documentation for .NET usage of the Authy API lives in the official Twilio documentation.
The Authy API supports multiple channels of 2FA:
- One-time passwords via SMS and voice.
- Soft token (TOTP via the Authy App)
- Push authentication via the Authy App
If you only need SMS and Voice support for one-time passwords, we recommend using the Twilio Verify API instead.
More on how to choose between Authy and Verify here.
For a full tutorial, check out the .NET Authy Quickstart in our docs:
OR
Phone verification now lives in the Twilio API and has C#/.NET support through the official Twilio helper libraries.
Verify V1 is not recommended for new development. Please consider using Verify V2.
Note: this library is no longer actively maintained and may be incompatible with the version of .NET in your project. The documentation above will point you to maintained libraries and code samples.
With the Visual Studio IDE:
Install-Package Authy.Net
OR
With .NET Core command line tools:
dotnet add package Authy.Net
To use the Authy client, create an instance of AuthyClient and initialize it with your production API Key found in the Twilio Console:
using Authy.Net;
var client = new AuthyClient("your_api_key", test:false);
All of the methods return a result object specific to the call. There is always a Status property and a RawResponse property. The raw response can be used to get additional information when debugging problems but generally isn't needed in actual code.
- Success
- BadRequest
- Unauthorized
- This can mean that your API key is invalid or that the provided token is invalid. Once your integration has been tested it likely means that the token is invalid but the raw response will provide more info.
- ServiceUnavailable
Copyright (c) 2015-2020 Authy Inc. See LICENSE.txt for further details.