Like this demo? Share it!
The fundamental operations related to Access Manager are granting and revoking access to keys and channels. In our chat example we will want to control who can join the chat room (subscribe) as well as be able to contribute to the chat (publish).
When you open up this page you are assigned an authorization key. This is a randomly generated key that identifies your browser instance. When you press login, the code below is then executed on the server to grant you access to send messages into the chat room. The code is an easy to use call in the existing PubNub library:
pubnub.grant({ channel : 'chat', auth_key : 'abxyz12-auth-key-987tuv', read : true, write : true, ttl : 1 });
Today’s users expect to interact in real-time. PubNub makes it easy for you to add real-time capabilities to your apps, without worrying about the infrastructure. Build apps that allow your users to engage in real-time across mobile, browser, desktop and server.
The PubNub Real-Time Network takes care of the connections, global infrastructure and key building blocks for real-time interactivity, so you can focus creating killer apps…