Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Respoke api authentication error

I am implementing iOS app where I have to implement Respoke SDK for audio and video calling. Audio and video functionality is working fine in development mode but In production mode it gives me error "Api authentication error". I have used this code for production:

        [self.client connectWithTokenID:[[aryResult valueForKey:@"data"]valueForKey:@"token"] initialPresence:nil errorHandler:^(NSString *errorMessage)
         {
             [self showError:errorMessage];
         }];

For reference, I have used this : Respoke Documentation

Please tell me what is missing in my end. Please help me out.

Thanks a lot in advance!

like image 310
Sudha Tiwari Avatar asked Nov 10 '22 05:11

Sudha Tiwari


1 Answers

It seems most likely you are having one of these problems:

  1. The value returned by [[aryResult valueForKey:@"data"]valueForKey:@"token"] is not exactly the same as the value returned by the Respoke server when asking for a brokered authentication token from https://api.respoke.io/v1/tokens due to URL encoding of the data between the server and your iOS application or something similar.
  2. The brokered authentication token is only valid for 20 seconds, so perhaps too much time has passed before your iOS application attempts to use it.
  3. You have not switched your application out of development mode on the Respoke developer portal, or have not created a role to use when authenticating. This documentation page explains how to properly set up your application and define a role for using brokered authentication. You can also use the example code on that page to make sure that you are getting a valid token for your application. This would help make sure you have your account configured correctly.
like image 167
jzn Avatar answered Nov 14 '22 21:11

jzn