C#.NET: Generate API Key using Nuget Library
API keys are used in authorization process of either a web product, desktop application or mobile application, So, generation of a secure API key typically requires a combination of a password and a secret/salt key. I have recently created my own small REST Web API Authorization library Asmak9.AuthorizeRESTWebApiAK which is compatible with any ASP.NET and .NET Console Application project. The library also provides a facility to generate a random API key.
Today, I shall be demonstrating integration of Asmak9.AuthorizeRESTWebApiAK .NET library with C#.NET Console Application.
1) Create a new C#.NET Console Application project and name it "GenerateApiKey".
2) Open "Tools\Nuget Package Manage\Manage Nuget Packages for Solution...".
3) Install Asmak9.AuthorizeRESTWebApiAK NuGet Package i.e.
4) Open "Program.cs" file and add following lines of code i.e.
The above code will generate an API key value base on your provided password and secret/salt key values. If you have purchased the license key of this library then you can provide your license key in the last parameter i.e.
5) Now, execute the project and you will be able to see following output i.e.
Today, I shall be demonstrating integration of Asmak9.AuthorizeRESTWebApiAK .NET library with C#.NET Console Application.
Prerequisites:
Following are some prerequisites before you proceed any further in this tutorial:- Install Asmak9.AuthorizeRESTWebApiAK NuGet Package.
- Knowledge of C# Programming.
Download Now!
Let's begin now.1) Create a new C#.NET Console Application project and name it "GenerateApiKey".
2) Open "Tools\Nuget Package Manage\Manage Nuget Packages for Solution...".
3) Install Asmak9.AuthorizeRESTWebApiAK NuGet Package i.e.
4) Open "Program.cs" file and add following lines of code i.e.
... // Initialization. string myPassword = "mypassword"; string mysaltKey = "mysaltkey"; // Generate API key. string apiKey = RESTWebAPIKey.GenerateAPIKey(myPassword, mysaltKey); ...
The above code will generate an API key value base on your provided password and secret/salt key values. If you have purchased the license key of this library then you can provide your license key in the last parameter i.e.
... // Initialization. string myPassword = "mypassword"; string mysaltKey = "mysaltkey"; // Generate API key. string apiKey = RESTWebAPIKey.GenerateAPIKey(myPassword, mysaltKey, "MY_LICENSE_KEY"); ...
5) Now, execute the project and you will be able to see following output i.e.
Thanks For sharing valuable Information....
ReplyDeleteMovie box is excellent application for them who love to enjoy
their time with movies and TV series.There was a time when watching
and downloading movies.
movies box apk
moviebox download android