The community forums are in BETA and closed to the public.

How can I authenticate a channel ?

I am so damn irritated with this. Can anyone please for god sake tell me how can I authenticate a channel ???

ERROR:

SUBSCRIBE : ERROR on channel 54013eec6eb2361f058b4567 : [Error: 112-0] : Authentication Failure. Incorrect Authentication Key : {"channels":["54013eec6eb2361f058b4567"]} : Forbiddencallback_messagemk----> Bundle[{message=SUBSCRIBE : ERROR on channel 54013eec6eb2361f058b4567 : [Error: 112-0] : Authentication Failure. Incorrect Authentication Key : {"channels":["54013eec6eb2361f058b4567"]} : Forbidden}]

CODE:

  if (mPubnub == null) {
               mPubnub = new Pubnub("", SUBSCRIBERKEY);
               mPubnub.setCacheBusting(false);
               String authToken = ChatUtils.getMD5HashKey(jsondata.getString(SESSIONTOKEN));
               mPubnub.setAuthKey(authToken);


           mPubnub.setUUID(ChatConstant.CHANNELID);
           mPubnub.isResumeOnReconnect();
           mPubnub.subscribe(ChatConstant.CHANNELID, pubnubConnectionCallback);
       }

PS, please send me a link to documentation on authentication

Surinder, did you grant access (read access in this case) with an instance of Pubnub that uses your 'secret-key'?

http://www.pubnub.com/docs/java/javase/tutorial/access-manager.html#_step_3_granting_revoking_access

Once you grant access to an auth-key, you pass that auth-key to a client that needs it to initialize the Pubnub object or set it after it is initialized as you are doing in the code you provided.

If that doesn't work, try running audit to see your grants and verify that you have granted properly.


Comments to this discussion are now closed!