Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sha3sha3/UE-EasyJWT

JWT wrapper (Engine Sub-system) for Unreal Engine.
https://github.com/sha3sha3/UE-EasyJWT

authentication cpp dss-plugin jwt jwt-authentication mmo unreal-engine unreal-engine-4 unreal-engine-5 unrealengine

Last synced: 14 days ago
JSON representation

JWT wrapper (Engine Sub-system) for Unreal Engine.

Awesome Lists containing this project

README

        

# This project is no longer maintained on GitHub, but you may obtain the latest maintained version on [Unreal Marketplace](https://www.unrealengine.com/marketplace/en-US/product/easy-jwt).





EasyKafakLogo



Json Web Tokens for Unreal Engine 4/5


# EasyJwt subsystem

EasyJwt is a JSON web tokens engine sub-system for Unreal Engine 4/5, that provides a c++ and bluprint interface to Generate, Sign, Verify and manage claims of JWT.

# Supported Platforms

- Windows x86_64
- Hololens 2 (Windows ARM64)
- Linux x86_64
- Linux ARM64

# C++ Modules Link

Link the plugin modules to your project through `.build.cs`:

```cs
bEnableExceptions = true;//we are using exceptions

PrivateDependencyModuleNames.AddRange( new string[]
{
"EasyJwt",
"JwtCpp",
"JwtVerifier",
"JwtGenerator"
});
```
# JWT Generator Basic Usage

## C++
Initialize the Generator

```cpp
#include "EasyJwtSubsystem.h"

TSharedPtr EasyJwt = GEngine->GetEngineSubsystem()->GetEasyJwt();
EasyJwt->GetGenerator()->InitGenerator(``, EGeneratorAlgorithm::HS256);
```

Generate Signed Token Basic Example:

```cpp
#include "EasyJwtSubsystem.h"

TSharedPtr EasyJwt = GEngine->GetEngineSubsystem()->GetEasyJwt();

TMap Claims =
{
{"Claim1","34235"},
{"Claim2","dfgds"}
};

TMap HeaderClaims =
{
{"HeaderClaim1","345343"},
{"HeaderClaim2","jhgfdrtt"}
};
/*
Valid since generating it and for 900sec with the givem claims.
*/
FString JwtToken = EasyJwt->GetGenerator()->GenerateJwtToken(true, 0, 900, Claims, HeaderClaims);
```
## Blueprint

Initialize the Generator

InitGenerator

Generate Signed Toker

GenerateToken

Blueprint API

GeneratorBp

# JWT Verifier Basic Usage

## C++
Initialize the Verifier

```cpp
#include "EasyJwtSubsystem.h"

TSharedPtr EasyJwt = GEngine->GetEngineSubsystem()->GetEasyJwt();

EasyJwt->GetVerifier()->InitVerifier(``, EVerifierAlgorithm::HS256);
```

Verify a Token

```cpp
#include "EasyJwtSubsystem.h"

TSharedPtr EasyJwt = GEngine->GetEngineSubsystem()->GetEasyJwt();

bool bValid = EasyJwt->GetVerifier()->VerifyJWT(``);
```

Get Claims From JWT

```cpp
#include "EasyJwtSubsystem.h"

TSharedPtr EasyJwt = GEngine->GetEngineSubsystem()->GetEasyJwt();

TMap Claims = EasyJwt->GetVerifier()->GetClaims(``);
```

## Blueprint

Initialize the Verifier

InitVerifier

Verify a Token

GenerateToken

Extract Claims From a JWT

Claims

Blueprint API

VerifierBp

## Supported Algorithms

- HS256
- HS348
- HS512
- RS256
- RS384
- RS512
- ES256 [Unreal Marketplace version only](https://www.unrealengine.com/marketplace/en-US/product/easy-jwt)
- ES384 [Unreal Marketplace version only](https://www.unrealengine.com/marketplace/en-US/product/easy-jwt)
- ES512 [Unreal Marketplace version only](https://www.unrealengine.com/marketplace/en-US/product/easy-jwt)
- PS256 [Unreal Marketplace version only](https://www.unrealengine.com/marketplace/en-US/product/easy-jwt)
- PS384 [Unreal Marketplace version only](https://www.unrealengine.com/marketplace/en-US/product/easy-jwt)
- PS512 [Unreal Marketplace version only](https://www.unrealengine.com/marketplace/en-US/product/easy-jwt)

More to come soon!!

## Find it helpful?

Give us a ⭐️!