Struct: FAPITokenInfo
// APITokenInfo.h : 9
struct NBPATREONAPICLIENT_API FAPITokenInfo;
Reflection-enabled
Specifiers:
- BlueprintType
Stores an API access token and related information.
Properties
-
AccessToken
public: FString AccessToken;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Token
Access token used to make authenticated requests (e.g. retrieve user identity info). This is usually obtained via oath. -
RefreshToken
public: FString RefreshToken;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Token
When the AccessToken expires, this token can be used to request a new access token without requiring the user to login again. -
Scopes
public: FString Scopes;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Token
The scopes AccessToken is allowed to access. This may differ from the scopes which were requested during authentication. -
TokenLifetime
public: FTimespan TokenLifetime;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Token
The time (in seconds) after TokenReceived that the AccessToken is valid. If `FDateTime::Now() - (TokenReceived + TokenLifetime)` is < 0, the **`Self::AccessToken`** has expired. -
TokenReceived
public: FDateTime TokenReceived;
Reflection-enabled
Specifiers:
- EditAnywhere
- BlueprintReadWrite
- Category = NBPatreonAPIClient|Token
The time (UTC) AccessToken and RefreshToken were received. This is used to check if the AccessToken is still valid before attempting to use it.
Constructors
-
FAPITokenInfo
// APITokenInfo.h : 49 public: FAPITokenInfo();
-
FAPITokenInfo
// APITokenInfo.h : 51 public: FAPITokenInfo( FString accessToken, FString refreshToken, int64 lifetime, FString scopes );
Arguments
-
accessToken
FString accessToken
-
refreshToken
FString refreshToken
-
lifetime
int64 lifetime
-
scopes
FString scopes
-
Methods
-
HasTokenExpired
// APITokenInfo.h : 61 public: bool HasTokenExpired() const;
-
IsValid
// APITokenInfo.h : 68 public: bool IsValid() const;
Checks that there is an access token which has not yet expired. Does not check the refresh token.
Returns
-
bool
-
-
RemainingLifetime
// APITokenInfo.h : 56 public: FTimespan RemainingLifetime() const;
For any questions, help, suggestions or feature requests, please feel free to contact me at nbpsup@gmail.com