Access Manager v3 Migration Guide
Access Manager v3 is a cryptographic, token‑based permission system that lets you regulate client access to PubNub resources, such as channels, channel groups, and User IDs. Access Manager helps you increase security and prevent access without explicit permission. This guide is for developers using Access Manager v2.
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.
The v3 model lowers latency and improves stability. Complexity moves from authorization to grant requests. Tokens returned by the grant API work immediately. Clients are less likely to see latency on API calls. v3 adds security options and more flexible permission checks. See the Access Manager v3 feature description.
If your app uses v2 today, PubNub continues to process requests. We recommend migrating to v3. This guide summarizes the differences, compares data flows, and outlines migration steps.
Differences between v2 and v3
See all the major differences between the two versions:
Feature | Access Manager v2 | Access Manager v3 |
---|---|---|
Authentication method | Authentication key generated by the client. | Token generated by PubNub upon a grant request made by the server. |
Permissions storage | Permissions are stored as an access control list (ACL) in the database on the PubNub server. | Permissions are embedded in a token (self-contained). |
Permissions expiration | Each resource has its own unique ttl (time to live). | There is one ttl that's set at a token level. |
Authorization check latency | Database lookup is required and that increases latency. | Instant check as permissions are embedded in the token. |
Grant latency | High latency | Low latency - clients can connect immediately after they receive tokens. |
Pattern-based permissions | It supports only one-level wildcard notations (a.* ) for the channel resource. | It supports RegEx for channels , groups (channel groups), and uuids . |
Multiple permission grants | You must make separate API calls for multiple permission sets. | You can make a single API call to define multiple permission sets for a given authorized User ID. |
Differences in data flows
Typical PubNub solutions that use Access Manager include a centralized, customer-developed server application that initializes a PubNub SDK with a secretKey
allowing the server to make calls to the PubNub grant API. Clients connect with this server through application-specific interfaces developed by the customer. The following descriptions show examples of client-server interactions initiated by a user logging in to the client device. The idea behind it is to demonstrate how permissions are governed and distributed in both Access Manager versions, and how these flows differ.