Access Manager v3 API for Unreal SDK

Access Manager isn't enabled by default
Until you enable it, any client that connects to this keyset can publish, subscribe, and reach channels and metadata. PubNub runs no permission checks. Enable Access Manager in the Admin Portal before you deploy to production.

Access Manager allows you to enforce security controls for client access to resources within the PubNub Platform. With Access Manager v3, your servers (that use a PubNub instance configured with a secret key) can grant their clients tokens with embedded permissions that provide access to individual PubNub resources:

  • For a limited period of time.
  • Through resource lists or patterns (regular expressions).
  • In a single API request, even if permission levels differ (read to channel1 and write to channel2).

You can add the authorizedUuid parameter to the grant request to restrict the token usage to one client with a given userId. Once specified, only this authorizedUuid will be able to use the token to make API requests for the specified resources, according to permissions given in the grant request.

User ID / UUID

User ID is also referred to as UUID/uuid in some APIs and server responses but holds the value of the userId parameter you set during initialization.

icon

Usage in Blueprints and C++


Asynchronous and synchronous method execution

Most PubNub Unreal SDK methods are available in both asynchronous and synchronous variants.

  • Asynchronous methods (Async suffix) return void and take an optional delegate parameter that fires when the operation completes.

    1PubnubClient->GrantTokenAsync(30, "my-user", Permissions, OnGrantTokenResponseDelegate);

    You can also use native callbacks that accept lambdas instead of dynamic delegates. Native callback types have the Native suffix (for example, FOnPubnubGrantTokenResponseNative).

  • Synchronous methods (no suffix) block the main game thread until the operation completes and return a result struct directly.

    1FPubnubGrantTokenResult Result = PubnubClient->GrantToken(30, "my-user", Permissions);

Grant token​

Requires Access Manager add-on

This method requires that the Access Manager add-on is enabled for your key in the Admin Portal. See Enable the features your app calls.

Requires Secret Key authentication

Granting permissions to resources should be done by administrators whose SDK instance has been initialized with a Secret Key (available on the Admin Portal on your app's keyset).

In the Unreal SDK, you set SecretKey on FPubnubConfig before you call CreatePubnubClient. The client applies SecretKey only at creation, and no setter exists to change it later. If SecretKey isn't empty, the client uses it from creation. There's no separate step to turn it on. Never ship the secret key in client builds.

The GrantToken() method generates a time-limited authorization token with an embedded access control list. The token defines time to live (TTL), AuthorizedUser, and a set of permissions giving access to one or more resources:

  • Channels
  • ChannelGroups
  • Uuids (other users' object metadata, such as their names or avatars)
  • Categories (list all channel or user metadata on the subscribe key, not one named resource)

Only this AuthorizedUser will be able to use the token with the defined permissions. The authorized client will send the token to PubNub with each request until the token's TTL expires. Any unauthorized request or a request made with an invalid token will return a 403 with a respective error message.

The grant request allows your server to securely grant your clients access to the resources within the PubNub Platform. There is a limited set of operations the clients can perform on every resource:

ResourcePermissions
Channelsread, write, get, manage, update, join, delete
ChannelGroupsread, manage
Uuidsget, update, delete
Categories (Channels, Users)get only

In GrantToken, Channels sets the channels category and Users sets the uuids category.

  • A category permission lets a token list all metadata of one resource type on your subscribe key. Valid categories are channels and uuids. The only permission is get (32).
  • A get permission on one named channel or user, or on a pattern, does not grant a category.
  • A token can contain only categories. It needs no resource or pattern.
  • When enumeration enforcement is enabled for a keyset, App Context list requests from a token or auth key without the matching category permission return a 403 error.

AuthorizedUser is required even when the token holds only categories.

For permissions and API operations mapping, refer to Manage Permissions with Access Manager v3.

Method(s)​

1PubnubClient->GrantTokenAsync(
2 int Ttl,
3 FString AuthorizedUser,
4 const FPubnubGrantTokenPermissions& Permissions,
5 FOnPubnubGrantTokenResponse OnGrantTokenResponse,
6 FString Meta = ""
7);
required
Ttl required#
Type: int
Time-To-Live (TTL) in minutes for the granted token.
AuthorizedUser required#
Type: FString
The User ID that is authorized by this grant.
Permissions required#
Type: const FPubnubGrantTokenPermissions&
Permissions applied to the listed resources.
OnGrantTokenResponse required#
The delegate for the operation's result.

You can also use a native callback of the type FOnPubnubGrantTokenResponseNative to handle the result using a lambda.
Meta#
Type: FString
Additional metadata to be included in the token.

FPubnubGrantTokenPermissions​

Channels#
A list of exact channel names and their associated permissions. Applied to the resources.channels section of the grant token.
ChannelGroups#
A list of exact channel group names and their associated permissions. Applied to the resources.groups section of the grant token.
Users#
Type: TArray<FUserGrant>
A list of exact user IDs and their associated permissions. Applied to the resources.uuids section of the grant token.
ChannelPatterns#
A list of channel name patterns (regular expressions) and their associated permissions. Applied to the patterns.channels section of the grant token.
ChannelGroupPatterns#
A list of channel group name patterns (regular expressions) and their associated permissions. Applied to the patterns.groups section of the grant token.
UserPatterns#
Type: TArray<FUserGrant>
A list of user ID patterns (regular expressions) and their associated permissions. Applied to the patterns.uuids section of the grant token.
Categories#
Lists all channel metadata (Channels) or all user metadata (Users) on the subscribe key. Applied to the categories section of the grant token. Named resource and pattern permissions do not grant this.

FChannelGrant​

FieldTypeDescription
ChannelFStringThe ID of a single Channel if used in the "Channels" field of [FPubnubGrantTokenPermissions](#fpubnubgranttokenpermissions) or a regular expression pattern if used in the "ChannelPatterns" field.
PermissionsFPubnubChannelPermissionsPermissions to grant for the specified Channel name or pattern.

FChannelGroupGrant​

FieldTypeDescription
ChannelGroupFStringThe name of a single Channel Group if used in the "ChannelGroups" field of [FPubnubGrantTokenPermissions](#fpubnubgranttokenpermissions) or a regular expression pattern if used in the "ChannelGroupPatterns" field.
PermissionsFPubnubChannelGroupPermissionsPermissions to grant for the specified Channel Group name or pattern.

FUserGrant​

FieldTypeDescription
UserFStringThe ID of a single User if used in the "Users" field of [FPubnubGrantTokenPermissions](#fpubnubgranttokenpermissions) or a regular expression pattern if used in the "UserPatterns" field.
PermissionsFPubnubUserPermissionsPermissions to grant for the specified User ID or pattern.

FPubnubCategoryPermissions​

FieldTypeDescription
ChannelsboolWhen true, the token can list all channel metadata. Applied to categories.channels in the grant token. Default false.
UsersboolWhen true, the token can list all user metadata. Applied to categories.uuids in the grant token. Default false.

FPubnubChannelPermissions​

FieldTypeDescription
ReadboolRead permission. Applies to Subscribe, History, and Presence.
WriteboolWrite permission. Applies to Publish.
DeleteboolDelete permission. Applies to History and App Context.
GetboolGet permission. Applies to App Context.
UpdateboolUpdate permission. Applies to App Context.
ManageboolManage permission. Applies to Channel Groups and App Context.
JoinboolJoin permission. Applies to App Context.

FPubnubChannelGroupPermissions​

FieldTypeDescription
ReadboolRead permission. Applies to presence and history access for the group.
ManageboolManage permission. Applies to modifying members of the group.

FPubnubUserPermissions​

FieldTypeDescription
DeleteboolDelete permission. Allows deletion of user metadata.
GetboolGet permission. Allows retrieval of user metadata.
UpdateboolUpdate permission. Allows updating of user metadata.

For a successful grant request, you must specify permissions for at least one User, channel, or group, either as a resource list or as a pattern (RegEx), or set Categories. You can specify the permissions in the following ways:

  • apply the same permission to multiple objects

    1// permission1 as applied to all channels
    2Channels = {channel1, channel2, channel3}
    3Permisions = {permission1}
  • apply different permissions to multiple objects

    1// the indexes in the Channels array correspond to the indexes in the Permissions array
    2// so channel1 gets permission1, channel2 permission2, etc
    3Channels = {channel1, channel2, channel3}
    4Permisions = {permission1, permission2, permission3}

If you provide more than one permission to multiple objects, an error will be thrown.

1// this throws an error as the permissions don't match the objects
2Channels = {channe1, channel2, channel3}
3Permisions = {permission1, permission2}

Sample code​

Actor.h​


1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void GrantTokenSample();
5
6UFUNCTION()
7void OnGrantTokenResponse_Simple(FPubnubOperationResult Result, FString Token);

Actor.cpp​


1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::GrantTokenSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 // SERVER ONLY: GrantToken requires SecretKey on the client config and must not be used in shipped game clients.
8 // Use only in dedicated servers or backend tooling. For client apps, mint PAM v3 tokens server-side and use SetAuthToken.
9 // Provide SecretKey in FPubnubConfig when creating the client. It cannot be changed after the client exists.
10
11 // Create the permissions structure
12 FPubnubGrantTokenPermissions Permissions;
13
14 //Add Read and Write permissions to "global_chat" channel
15 FChannelGrant ChannelGrant;
show all 43 lines

Returns​

This method is void. The delegate returns the following struct:

FOnPubnubGrantTokenResponse​

Delegate type: DECLARE_DYNAMIC_DELEGATE_TwoParams

Result#
The result of the operation.
Token#
Type: FString
The token that was granted.

FOnPubnubGrantTokenResponseNative​

Native callback variant that accepts a lambda.

Result#
The result of the operation.
Token#
Type: FString
The token that was granted.

Other examples​

Grant an authorized client access to list all channel and user metadata​

The code below grants my-authorized-user the get category permission for both Channels and Users, so the client can list all channel and user metadata on the subscribe key.

Actor.h​


1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void GrantTokenCategoriesSample();
5
6UFUNCTION()
7void OnGrantTokenResponse_Categories(FPubnubOperationResult Result, FString Token);
8

Actor.cpp​


1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::GrantTokenCategoriesSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 // SERVER ONLY: GrantToken requires SecretKey on the client config and must not be used in shipped game clients.
8 // Use only in dedicated servers or backend tooling. For client apps, mint PAM v3 tokens server-side and use SetAuthToken.
9 // Provide SecretKey in FPubnubConfig when creating the client. It cannot be changed after the client exists.
10
11
12 // Create the permissions structure
13 FPubnubGrantTokenPermissions Permissions;
14
15 //Allow listing all channel metadata and all user metadata. No channel, group or user resources are needed.
show all 41 lines

Grant an authorized client different levels of access to various resources in a single call​

The code below grants my-authorized-user:

  • Read access to channel-a, channel-group-b, and get to user-c.
  • Read/write access to channel-b, channel-c, channel-d, and get/update to user-d.

Actor.h​


1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void GrantTokenVariousResourcesSample();
5
6UFUNCTION()
7void OnGrantTokenResponse_VariousResources(FPubnubOperationResult Result, FString Token);

Actor.cpp​


1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::GrantTokenVariousResourcesSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 // SERVER ONLY: GrantToken requires SecretKey on the client config and must not be used in shipped game clients.
8 // Use only in dedicated servers or backend tooling. For client apps, mint PAM v3 tokens server-side and use SetAuthToken.
9 // Provide SecretKey in FPubnubConfig when creating the client. It cannot be changed after the client exists.
10
11 // Create the permissions structure
12 FPubnubGrantTokenPermissions Permissions;
13
14 //Add Read permission to channel "channel-a"
15 FChannelGrant ChannelAGrant;
show all 72 lines

Grant an authorized client read access to multiple channels using RegEx​

The code below grants my-authorized-user read access to all channels that match the channel-[A-Za-z0-9] RegEx pattern.

Actor.h​


1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void GrantTokenRegexSample();
5
6UFUNCTION()
7void OnGrantTokenResponse_Regex(FPubnubOperationResult Result, FString Token);
8

Actor.cpp​


1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::GrantTokenRegexSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 // SERVER ONLY: GrantToken requires SecretKey on the client config and must not be used in shipped game clients.
8 // Use only in dedicated servers or backend tooling. For client apps, mint PAM v3 tokens server-side and use SetAuthToken.
9 // Provide SecretKey in FPubnubConfig when creating the client. It cannot be changed after the client exists.
10
11 // Create the permissions structure
12 FPubnubGrantTokenPermissions Permissions;
13
14 //Add Read permission to the whole channels pattern
15 FChannelGrant ChannelPatternGrant;
show all 42 lines

Grant an authorized client different levels of access to various resources and read access to channels using RegEx in a single call​

The code below grants the my-authorized-user:

  • Read access to channel-a, channel-group-b, and get to user-c.
  • Read/write access to channel-b, channel-c, channel-d, and get/update to user-d.
  • Read access to all channels that match the channel-[A-Za-z0-9] RegEx pattern.
Actor.h​

1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void GrantTokenComplexSample();
5
6UFUNCTION()
7void OnGrantTokenResponse_Complex(FPubnubOperationResult Result, FString Token);
Actor.cpp​

1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::GrantTokenComplexSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 // SERVER ONLY: GrantToken requires SecretKey on the client config and must not be used in shipped game clients.
8 // Use only in dedicated servers or backend tooling. For client apps, mint PAM v3 tokens server-side and use SetAuthToken.
9 // Provide SecretKey in FPubnubConfig when creating the client. It cannot be changed after the client exists.
10
11 // Create the permissions structure
12 FPubnubGrantTokenPermissions Permissions;
13
14 //Add Read permission to channel "channel-a"
15 FChannelGrant ChannelAGrant;
show all 78 lines

Error responses​

If you submit an invalid request, the server returns HTTP 400 with a message that identifies the missing or incorrect argument. Causes can include a RegEx issue, an invalid timestamp, or incorrect permissions.

Revoke token​

Requires Access Manager add-on

This method requires that the Access Manager add-on is enabled for your key in the Admin Portal. See Enable the features your app calls.

Enable token revoke

To revoke tokens, you must first enable this feature on the Admin Portal. To do that, navigate to your app's keyset and mark the Revoke v3 Token checkbox in the ACCESS MANAGER section.

The RevokeToken() method allows you to disable an existing token and revoke all permissions embedded within. You can only revoke a valid token previously obtained using the GrantToken() method.

Use this method for tokens with TTL less than or equal to 30 days. If you need to revoke a token with a longer TTL, contact support.

For more information, refer to Revoke permissions.

Method(s)​

1PubnubClient->RevokeTokenAsync(
2 FString Token,
3 FOnPubnubRevokeTokenResponse OnRevokeTokenResponse
4);
required
Token required#
Type: FString
Default: no default
Existing token with embedded permissions.
OnRevokeTokenResponse required#
Default: no default
The delegate for the operation's result.

You can also use a native callback of the type FOnPubnubRevokeTokenResponseNative to handle the result using a lambda.

Sample code​

Actor.h​


1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void RevokeTokenSample();

Actor.cpp​


1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::RevokeTokenSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 // SERVER ONLY: RevokeToken requires SecretKey on the client config and must not be used in shipped game clients.
8 // Use only in dedicated servers or backend tooling. For client apps, mint PAM v3 tokens server-side and use SetAuthToken.
9 // Provide SecretKey in FPubnubConfig when creating the client. It cannot be changed after the client exists.
10
11 // Revoke the token
12 // ACTION REQUIRED: This is an old token, so revoking it will return an error. Replace with a valid token returned from GrantToken method, to get success response
13 FString TokenToRevoke = TEXT("p0F2AkF0GmheUpNDdHRsGDxDcmVzpURjaGFuoWtnbG9iYWxfY2hhdANDZ3JwoENzcGOgQ3VzcqBEdXVpZKBDcGF0pURjaGFuoENncnCgQ3NwY6BDdXNyoER1dWlkoERtZXRhoENzaWdYILa9OLrP_dhe31sW_seO2r9KhD6mp9Yi9vZxcX9QY04R");
14 PubnubClient->RevokeTokenAsync(TokenToRevoke);
15}

Returns​

This method is void. The delegate returns the following struct:

FOnPubnubRevokeTokenResponse​

Delegate type: DECLARE_DYNAMIC_DELEGATE_OneParam

Result#
The result of the operation.

FOnPubnubRevokeTokenResponseNative​

Native callback variant that accepts a lambda.

Result#
The result of the operation.

Other Examples​

Revoke a token with lambda​

You can use a lambda function to handle the response:

Actor.h​

1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void RevokeTokenWithResultLambdaSample();
Actor.cpp​

1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::RevokeTokenWithResultLambdaSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 // SERVER ONLY: RevokeToken requires SecretKey on the client config and must not be used in shipped game clients.
8 // Use only in dedicated servers or backend tooling. For client apps, mint PAM v3 tokens server-side and use SetAuthToken.
9 // Provide SecretKey in FPubnubConfig when creating the client. It cannot be changed after the client exists.
10
11 // Bind lambda to response delegate
12 FOnPubnubRevokeTokenResponseNative OnRevokeTokenResponse;
13 OnRevokeTokenResponse.BindLambda([](const FPubnubOperationResult& Result)
14 {
15 if(Result.Error)
show all 29 lines

Revoke a token with result struct​

You can use the result struct to handle the response:

Actor.h​

1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void RevokeTokenWithResultSample();
5
6UFUNCTION()
7void OnRevokeTokenResponse(FPubnubOperationResult Result);
Actor.cpp​

1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::RevokeTokenWithResultSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 // SERVER ONLY: RevokeToken requires SecretKey on the client config and must not be used in shipped game clients.
8 // Use only in dedicated servers or backend tooling. For client apps, mint PAM v3 tokens server-side and use SetAuthToken.
9 // Provide SecretKey in FPubnubConfig when creating the client. It cannot be changed after the client exists.
10
11 // Bind response delegate
12 // ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
13 FOnPubnubRevokeTokenResponse OnRevokeTokenResponse;
14 OnRevokeTokenResponse.BindDynamic(this, &ASample_AccessManager::OnRevokeTokenResponse);
15
show all 33 lines

Error responses​

If you submit an invalid request, the server returns an error status code with a descriptive message informing which of the provided arguments is missing or incorrect. Depending on the root cause, this operation may return the following errors:

  • 400 Bad Request
  • 403 Forbidden
  • 503 Service Unavailable

Parse token​

The ParseToken() method decodes an existing token and returns the object containing permissions embedded in that token. The client can use this method for debugging to check the permissions to the resources or find out the token's TTL details.

Method(s)​

1FString ParsedToken = PubnubClient->ParseToken(FString Token);
required
Token required#
Type: FString
Existing token with embedded permissions.

Sample code​

Actor.h​


1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void ParseTokenSample();

Actor.cpp​


1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::ParseTokenSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 //Parse the token
8 FString TokenToParse = TEXT("p0F2AkF0GmheUpNDdHRsGDxDcmVzpURjaGFuoWtnbG9iYWxfY2hhdANDZ3JwoENzcGOgQ3VzcqBEdXVpZKBDcGF0pURjaGFuoENncnCgQ3NwY6BDdXNyoER1dWlkoERtZXRhoENzaWdYILa9OLrP_dhe31sW_seO2r9KhD6mp9Yi9vZxcX9QY04R");
9 FString ParsedToken = PubnubClient->ParseToken(TokenToParse);
10
11 //If parsed token is empty it means that something went wrong. Check Output Log for more details.
12 if(ParsedToken.IsEmpty())
13 {
14 UE_LOG(LogTemp, Log, TEXT("Parsing Token failed."));
15 }
show all 20 lines

Read category permissions from a parsed token​

The code below parses a token and reads its category permissions.

Actor.h​


1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void ParseTokenCategoriesSample();

Actor.cpp​


1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::ParseTokenCategoriesSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 //Parse the token
8 // ACTION REQUIRED: Replace with a token returned from GrantToken method that was granted with Categories
9 FString TokenToParse = TEXT("qWF2AmF0GmVT8QBjdHRsGDxjcmVzpGRjaGFuoGNncnCgY3VzcqBkdXVpZKBjcGF0pGRjaGFuoGNncnCgY3VzcqBkdXVpZKBkbWV0YaBjY2F0omRjaGFuGCBkdXVpZBggZHV1aWRndXNlci14eGNzaWdYIAABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4f");
10 FString ParsedToken = PubnubClient->ParseToken(TokenToParse);
11
12 //If parsed token is empty it means that something went wrong. Check Output Log for more details.
13 if(ParsedToken.IsEmpty())
14 {
15 UE_LOG(LogTemp, Log, TEXT("Parsing Token failed."));
show all 46 lines

Returns​

ParseToken returns an FString that contains the JSON-encoded token contents:

1{
2 "Version": 2,
3 "Timestamp": 1752200000,
4 "TTL": 30,
5 "Resources": {
6 "Channels": {
7 "my_first_channel": {
8 "Read": true,
9 "Write": false,
10 "Manage": true,
11 "Delete": true,
12 "Get": false,
13 "Update": true,
14 "Join": true
15 }
show all 33 lines

The result includes a Categories object only when the token carries category grants. Its Channels and Users booleans are true only when the token can list all channel metadata or all user metadata. Both are false when that category is not granted. The Categories object doesn't depend on named resource permissions. When the token has no category grants, the Categories key is absent.

Error responses​

If you receive an error while parsing the token, it may suggest that the token is damaged. In that case, request the server to issue a new one.

Set token​

The SetAuthToken() method is used by the client devices to update the authentication token granted by the server.

Method(s)​

1// Synchronous
2PubnubClient->SetAuthToken(FString Token);
3
4// Asynchronous
5PubnubClient->SetAuthTokenAsync(FString Token);
required
Token required#
Type: FString
Default: no default
Existing token with embedded permissions. Pass an empty string to clear the token.

Sample code​

Actor.h​


1#include "PubnubClient.h"
2
3UFUNCTION(BlueprintCallable, Category = "Pubnub|Samples|Access Manager")
4void SetAuthTokenSample();
5

Actor.cpp​


1// ACTION REQUIRED: Replace ASample_AccessManager with name of your Actor class
2void ASample_AccessManager::SetAuthTokenSample()
3{
4
5 //Assumes PubnubClient is created and UserID is set
6
7 //Set Auth Token
8 FString Token = TEXT("p0F2AkF0GmheUpNDdHRsGDxDcmVzpURjaGFuoWtnbG9iYWxfY2hhdANDZ3JwoENzcGOgQ3VzcqBEdXVpZKBDcGF0pURjaGFuoENncnCgQ3NwY6BDdXNyoER1dWlkoERtZXRhoENzaWdYILa9OLrP_dhe31sW_seO2r9KhD6mp9Yi9vZxcX9QY04R");
9 PubnubClient->SetAuthToken(Token);
10}

Returns​

This method doesn't return any response value.

Was this page useful?

Last updated on