4

Recently a production app of mine began throwing exceptions due to some weird behavior with the grant/audit functions. To summarize, I can grant permissions to a channel/key combo and get a success response but when I audit the channel immediately afterwards it shows an empty channels result set. To rule out a bug in the application I verified this behavior in the pubnub developer console.

Grant Input/Output

grant input screenshot

RESPONSE:
{
  "auths": {
    "102cd0f27f216cc3ce7733e7a56ce1ae9e35407c": {
      "r": 1,
      "w": 0
    }
  },
  "subscribe_key": "sub-c-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "ttl": 0,
  "channel": "32f563fcc122d2b0db5f133b0967bcd8",
  "level": "user"
}

Audit Input/Output

audit input screenshot

RESPONSE:
{
  "channels": {

  },
  "subscribe_key": "sub-c-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "level": "channel"
}

I would expect to see the permissions that were just granted in the audit. Am I missing something silly?

Thanks.

Matt Z
  • 41
  • 2

1 Answers1

2

PubNub Grant/Revoke and Audit

This is unintended behavior and TTL 0 should work as you expect for a Forever Grant. We are working on the issue and will have it resolved shortly for you. Right now any grants less than 5 TTL are not saved. The instant solution for you right now is to grant above TTL of 5.

PubNub offers Access Control Management with Data Channels offering grant/revoke admin privileges to control permissions for your real time streams at the user/device, channel or key level. Access Control starts with Auth tokens from any existing authentication system like Facebook Connect, Twitter, Google, LDAP, or homegrown solutions.

PAM is a Serverless, easy to use, key based security solution for all of your apps allowing you to manage users and intervene in user actions when needed on a per subscriber basis. By default PubNub does not require ACL or security restrictions. With PubNub Access Manager you can provide Authorization and access control to channels for your users.

PubNub Access Manager

Stephen Blum
  • 6,498
  • 2
  • 34
  • 46
  • 1
    Some of PubNub's own responses to user questions suggest using a TTL of 0 for an indefinite auth. http://stackoverflow.com/a/21176844/2925455 . Is there any explanation or reason for the sudden change? – Matt Z Oct 07 '14 at 17:49
  • Matt Z you are correct! This is an unintended behavior and TTL 0 should work as you expect for a **Forever Grant**. We are working on the issue and will have it resolved shortly. – Stephen Blum Oct 07 '14 at 18:08
  • Oops, I did mean Forever Grant and not "indefinite". Thanks for the update. – Matt Z Oct 07 '14 at 18:14