Temasys / SkylinkSDK-iOS-Sample

Temasys SkylinkSDK for iOS - Sample App - Objective C
https://temasys.io
Other
16 stars 9 forks source link

Incorrect URL generated by connectToRoomWithCredentials #2

Closed sdac closed 9 years ago

sdac commented 9 years ago

Despite giving this function the correct credentials, it generates a URL of the form:

http://api.temasys.com.sg/api/8b787551-1cf7-43e3-a1fa-90d2f9444014/1/2015-07-09T12:18:23.0Z/100000.000000?cred=q8B1vimCZflsMWzQ3QqaQDYpI68%3D

Which is incorrect, the "duration" value is written as a double when the URL is created. This yields the response:

{
  "success": false,
  "error": 4005,
  "info": "The credentials is not matched for the apiKey . Please go to developer.temasys.com.sg to manage your api keys."
}

The issue can be fixed manually for each URL by removing the fractional part of the "duration" as shown below:

http://api.temasys.com.sg/api/8b787551-1cf7-43e3-a1fa-90d2f9444014/1/2015-07-09T12:18:23.0Z/100000?cred=q8B1vimCZflsMWzQ3QqaQDYpI68%3D

The above URLs can be verified using curl. Though since this behaviour is part of the SDK and out of our control we can't fix it ourselves.

I hope this issue will be fixed in short since it currently prevents us from using this lib.

sdac commented 9 years ago

Well I found a simple solution. :)

Apparently, we can work around it by simply adding six trailing zeros to the duration before generating the credentials (on the serverside).

janiduw commented 9 years ago

@sdac Thanks for reporting it. This looks like something that should be addressed in the SDK. I will be looking on to it.

janiduw commented 9 years ago

@sdac I fixed this on the SDK side. The new version will be released in the weeks to come. Thanks again for bringing our attention to this issue.