Loading...
Searching...
No Matches
FJwt Class Reference

Provide access to verify JWT and extract its content. More...

#include <AccelByteUtilities.h>

Public Member Functions

 FJwt (FString JwtString)
 Construct FJwt from JWT string.
EJwtResult VerifyWith (FRsaPublicKey Key) const
 Verify this JWT using RSA public key.
TSharedPtr< FJsonObject > const & Header () const
 Get header content from JWT. Content could be any valid JSON having at least "alg" field.
TSharedPtr< FJsonObject > const & Payload () const
 Get payload content from JWT. Content could be any valid JSON.
bool IsValid () const
 Check if this JWT format is correct and both and payload are valid JSON encoded as Base64URL.

Detailed Description

Provide access to verify JWT and extract its content.

Constructor & Destructor Documentation

◆ FJwt()

FJwt::FJwt ( FString JwtString)
explicit

Construct FJwt from JWT string.

Parameters
JwtStringJWT encoded as dot separated Base64Url string.

Member Function Documentation

◆ Header()

TSharedPtr< FJsonObject > const & FJwt::Header ( ) const

Get header content from JWT. Content could be any valid JSON having at least "alg" field.

Returns
JWT header.

◆ IsValid()

bool FJwt::IsValid ( ) const

Check if this JWT format is correct and both and payload are valid JSON encoded as Base64URL.

Returns
true if this JWT is valid, and
false if otherwise.

◆ Payload()

TSharedPtr< FJsonObject > const & FJwt::Payload ( ) const

Get payload content from JWT. Content could be any valid JSON.

Returns
JWT payload.

◆ VerifyWith()

EJwtResult FJwt::VerifyWith ( FRsaPublicKey Key) const

Verify this JWT using RSA public key.

Parameters
KeyRSA public key.
Returns
EJwtResult::Ok if signature match.