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
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.
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
- Ensure Windows Visual Studio 2019 is installed on your machine.
- Open duo_api_csharp in Visual Studio.
- In your Solution Explorer, select the duo_api_csharp.sln solution node.
- From there, in your Solution Explorer still, find the unit test project DuoApiTest.csproj.
- Open the Test Explorer window (Test > Test Explorer).
- 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.
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.
Report any bugs, feature requests, etc. to us directly: [email protected]
Have fun!