Example Files For Aaryan Auth

Download ready-to-use client libraries and example projects for your preferred language

C++ Example
Native Windows / Linux application
$ Requires: libcurl or WinHTTP
#include "auth.hpp" int main() { auto auth = KeyAuth::KeyAuthApp( "AppName", "OwnerID", "Secret", "1.0" ); auth.init(); auth.login(user, pass);
C# Example
WinForms, WPF, Console .NET
PM> Install-Package Newtonsoft.Json
public static api Auth = new api( name: "AppName", ownerid: "1", secret: "secret", version: "1.0" ); Auth.init(); Auth.login(user, pass);
Python Example
Python 3.6+ scripts and tools
$ pip install requests
from keyauth import Aaryan Auth auth = Aaryan Auth( name="AppName", ownerid="1", secret="secret" ) auth.init() auth.login(user, password)
PHP Example
PHP 7+ web apps and CLI scripts
php.ini: allow_url_fopen = On
<?php require_once 'auth.php'; $auth = new Aaryan Auth( 'AppName', '1', 'secret' ); $auth->init(); $r = $auth->login($user, $pass);
JavaScript Example
Node.js and Electron apps
$ npm install axios
const {Aaryan Auth} = require('./keyauth') const auth = new Aaryan Auth({ name: "AppName", ownerid: "1", secret: "secret" }) await auth.init() await auth.login(user, pass)
Java Example
Java 8+ — no extra dependencies
No extra deps — uses HttpURLConnection
Aaryan Auth auth = new Aaryan Auth( "AppName", "1", "secret", "1.0", "http://server/api/1.3/" ); auth.init(); auth.login("user", "pass");
VB.Net Example
WinForms and Console VB.Net
PM> Install-Package Newtonsoft.Json
Dim Auth As New api( name:="AppName", ownerid:="1", secret:="secret", version:="1.0" ) Auth.init() Auth.login(user, pass)
Lua Example
Lua 5.1+ and LuaJIT scripts
$ luarocks install lua-requests
local auth = require("keyauth") auth.init({ name="AppName", ownerid="1", secret="secret" }) auth.login(user, pass)