Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Latest commit

 

History

History
79 lines (51 loc) · 3.77 KB

README.md

File metadata and controls

79 lines (51 loc) · 3.77 KB

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

Authy .NET

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.

Authy Quickstart

For a full tutorial, check out the .NET Authy Quickstart in our docs:

2FA Workflow

  1. Create a user
  2. Send a one-time password
  3. Verify a one-time password

OR

  1. Create a user
  2. Send a push authentication
  3. Check a push authentication status

Phone Verification

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.

Authy.NET installation

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

Usage

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);

authy api key in console

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.

Response statuses are:

  1. Success
  2. BadRequest
  3. 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.
  4. ServiceUnavailable

Copyright

Copyright (c) 2015-2020 Authy Inc. See LICENSE.txt for further details.