Access Manager API for Cocoa Swift SDK
Access Manager allows you to enforce security controls for client access to resources within the PubNub Platform. With Access Manager v3, your servers can grant their clients tokens with embedded permissions that provide access to individual PubNub resources, such as channels, channel groups, and UUID metadata:
- For a limited period of time.
- Through resource lists or patterns (regular expressions).
- In a single API request, even if permission levels differ (
read
tochannel1
andwrite
tochannel2
).
You can add the authorized UUID parameter to the grant request to restrict the token usage to only one client with a given uuid
. Once specified, only this authorized UUID will be able to use the token to make API requests for the specified resources, according to permissions given in the grant request.
For more information about Access Manager v3, refer to Manage Permissions with Access Manager v3.
Client device support only
The Swift SDK supports only client implementation of Access Manager functionality. This means that you cannot use it to grant permissions, but rather to parse and set tokens received from a server SDK.
Parse token
The parse()
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
(time to live) details.