1

I am attempting to connect to pusher chatkit; however, everytime I attempt the connection I am receiving this response:

"Making attempt 5 of 6 in 16.0s. Error was: Bad response status code received: 401 with error message: services/chatkit_authorizer/authorization/missing_permission: User does not have access to requested resource"

After it makes 6 attempts it then connects, so I am not sure what the missing permission is.

Below is the code I am using to connect.

 self.chatManagerDelegate = MyChatManagerDelegate()

        chatManager = ChatManager(instanceLocator: Pusher_Chatkit.instanceLocator,
                                  tokenProvider: PCTokenProvider(url: Pusher_Chatkit.tokenProvider),
                                  userID: "user-id")

        chatManager.connect(delegate: chatManagerDelegate!) { currentUser, error in
            guard error == nil else {
                print("Error connecting: \(error!.localizedDescription)")
                return
            }
            print("Successfully connected")
  • Have you made any modifications to your roles of permissions that exist as part of your Chatkit instance? If you would like to debug this further then feel free to email hamilton@pusher.com with your instance locator and then I can write up an answer here with the resulting information so that others with the same issue can see what the root cause was for your issue. – hamchapman Jan 15 '19 at 15:30
  • @hamchapman thanks i will send you an email now! – Turtlenecksweater Jan 15 '19 at 16:28

1 Answers1

0

Make sure that you have the cursors:read:get permission enabled for the role that the user is trying to connect with. You can do this using the dashboard, one of our server SDKs, or the API directly.

Without this permission enabled the connection attempt will currently fail as all clients try to establish a subscription to receive read cursor updates, even if you don't use the read cursor functionality anywhere else in your app.

hamchapman
  • 2,901
  • 4
  • 22
  • 37