- Download and install the EditorConfig plugin for Visual Studio: https://github.com/editorconfig/editorconfig-visualstudio#readme
- Launch
premake.bat
- Open
Build/JWT.sln
- Create a directory junktion to MTA-Server directory in the root of the repo
mklink /J mta-server "PATH_TO_INSTALL_DIR\MTA San Andreas 1.5\server"
- Create a symlink to the build output dll in the modules directory
cd PATH_TO_INSTALL_DIR\MTA San Andreas 1.5\server\x64\modules
for x64cd PATH_TO_INSTALL_DIR\MTA San Andreas 1.5\server\mods\deathmatch\modules
for Win32mklink ml_jwt.dll "PATH_TO_REPO\Bin\Debug\ml_jwt.dll"
- Press
F5
in Visual Studio and the MTA-Server should start
- Put the resulting
Bin/ml_jwt.dll/.so
into your MTA:SA servermodules
folder. - Add
<module src="ml_jwt.dll"/>
(or.so
for Linux) to yourmtaserver.conf
. - Start the server
- libcrypto (openssl or compatible)
- libssl-dev (for the header files)
JWT_ALGORITHM_HS256
JWT_ALGORITHM_HS384
JWT_ALGORITHM_HS512
JWT_ALGORITHM_RS256
JWT_ALGORITHM_RS384
JWT_ALGORITHM_RS512
bool jwtSign(function(string/boolean) callback, table claims, JWT_ALGORITHM algorithm, string secret/private_key_path, bool is_file_path = false)
- callback: Lorem ipsum
- claims: Lorem ipsum
- algorithm: Lorem ipsum
- secret/private_key_path Lorem ipsum
- is_file_path Lorem ipsum
Returns true if everything went fine, false otherwise.
bool jwtVerify(function(boolean) callback, string token, string secret/public_key_path, bool is_file_path = false)
- callback: Lorem ipsum
- token: Lorem ipsum
- secret/file_path Lorem ipsum
- is_file_path Lorem ipsum
Returns true if everything went fine, false otherwise.
table jwtGetClaims(string token)
- token: Lorem ipsum
Returns a table containing the claims.
via https://github.com/Contextualist/glare
- Stefan K.