Fork me on GitHub

PubNub Access Manager

Securing Real-Time Applications

Secure Your Real-Time Apps

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).

How it Works

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
});

What is PubNub?

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.

What Can I Build With PubNub?

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…

  • Real-Time Collaboration
  • Machine-to-Machine
  • Real-Time Financial Streams
  • Real-Time Location Tracking
  • Call Triggering
  • 2nd Screen Sync
  • Live Dashboards
  • Multi-Player Games
  • Group Chat Rooms
  • Thousands more…

Start Building Real-Time Apps Now!