duosecurity / duo_api_csharp

Other
32 stars 31 forks source link

Overview

Build Status Issues Forks Stars License

duo_api_csharp - Demonstration client to call Duo API methods with .NET and C#.

For more information see our Duo for Developers page:

https://www.duosecurity.com/api

TLS 1.2 and 1.3 Support

Duo_api_csharp uses the .NET libraries for TLS operations. .NET 4.7 or later is required for TLS 1.2; .NET 4.8 or later is required for TLS 1.3.

In addition, version 1.0.0 of duo_api_csharp is required, since prior versions targeted .NET 4.5 which does not support TLS 1.2 or 1.3.

Installing

A Windows machine is required to run and test duo_api_csharp.

Development:

$ git clone https://github.com/duosecurity/duo_api_csharp.git
$ cd duo_api_csharp

Testing

  1. Ensure Windows Visual Studio 2019 is installed on your machine.
  2. Open duo_api_csharp in Visual Studio.
  3. In your Solution Explorer, select the duo_api_csharp.sln solution node.
  4. From there, in your Solution Explorer still, find the unit test project DuoApiTest.csproj.
  5. Open the Test Explorer window (Test > Test Explorer).
  6. Run the unit tests by selecting on the top test and hitting the Run All button. There should be about 25 tests. Visit Microsoft's "Get started with unit testing page" for more information and help.

Running the examples project

The example project (examples/Examples.csproj) connects to an Admin API instance and fetches some data to display to the command line. To run it, create a Duo Admin API instance following these instructions, making sure to enable Read permissions. Then, after building the example, you can invoke it using the command below, replacing the integration key, secret, and api hostname with the values for your API instance:

.\examples\bin\Debug\Examples.exe <IntegrationKey> <SecretKey> <API Hostname>

If successful, the command will output a summary of authentications performed against your account.

Support

Report any bugs, feature requests, etc. to us directly: support@duosecurity.com

Have fun!

http://www.duosecurity.com