Quantcast
Channel: Kaltura - Latest posts
Viewing all articles
Browse latest Browse all 7410

Using same ks with different client objects

$
0
0

Hello,

The Kaltura API is stateless and you should always pass the KS when making API requests that require authentication/authorization.

To generate a KS with the JS client, you need to call:

client.session.start(function(success, ks) {
...
},
secret,
userId,
type,
partnerId,
expiry,
privileges);
}

The ks var will then contain a string which is the KS [Kaltura Session] which you need to assign to the client using:

client.setKs(ks);

From there onwards, you can use this client with this KS to make subsequent calls, until that KS expires.

That said, you can use the same KS with different clients rather than generating a new one using session.start(). Of course, bear in mind a KS has an expiry field, when null is passed for the expiry param, expiry will be set to 86400 seconds, which is 24 hours.

My guess, without looking at your code, is that you forgot to call client.setKs(ks) for the second client, but it's just a guess.

There is a step by step code tutorial about generating a KS and assigning it here:
https://developer.kaltura.com/recipes/authentication#/start

and you can toggle code in several languages, including JS.

Additional code samples are available here:
https://developer.kaltura.com/recipes

If you still have issues with your code, please post an actual code snippet so I can help you further.


Viewing all articles
Browse latest Browse all 7410

Trending Articles