According to the documentation, it appears that I should be requesting an app token session based on a widget session, but I’m getting a “KalturaException: The access to service [appToken->startSession] is forbidden (SERVICE_FORBIDDEN)”. I’m not sure if that’s because of the widgetSession itself, the particular hash I’ve built, the roles associated with the user/app token, or what exactly. Any help would be appreciated, even simply examples of how to get this to work in other languages.
Python code:
kaltura_session = client.session.startWidgetSession(widget_id)
token_session_hash = hashlib.sha1(kaltura_session.ks + app_token.token).hexdigest()
priveleged_kaltura_session = client.appToken.startSession(app_token.id, token_session_hash)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".../lib/python2.7/site-packages/KalturaClient/Plugins/Core.py", line 57471, in startSession
resultNode = self.client.doQueue()
File ".../lib/python2.7/site-packages/KalturaClient/Client.py", line 357, in doQueue
resultNode = self.parsePostResult(postResult)
File ".../lib/python2.7/site-packages/KalturaClient/Client.py", line 317, in parsePostResult
self.throwExceptionIfError(resultNode)
File ".../lib/python2.7/site-packages/KalturaClient/Client.py", line 385, in throwExceptionIfError
raise exceptionObj
KalturaException: The access to service [appToken->startSession] is forbidden (SERVICE_FORBIDDEN)
The access to service [appToken->startSession] is forbidden (SERVICE_FORBIDDEN)
Thank you @jess, that’s exactly what I needed. I forget the client.setKs, constantly. Seeing that many of the arguments to create the app token are optional is helpful, also.