Working with auth tokens from Ruby SDK
Ruby SDK offers you a way to handle auth tokens from the backend of your system.
Auth tokens allow you to add additional layer of security to your videos. While we offer a way to do this through dashboard, bellow you will see how you can do that and even more through the API calls.
Ruby SDK Authtoken Methods
- get Get a single auth token by token.
ziggeo.authtokens().get(token)
This method returns JSON - update Update single auth token by token.
ziggeo.authtokens().update(token_or_key, arguments = nil)
- volatile Will this object automatically be deleted if it remains empty?
- hidden If hidden, the token cannot be used directly.
- expiration_date Expiration date for the auth token (Unix epoch time format)
- usage_expiration_time Expiration time per session (seconds)
- session_limit Maximal number of sessions
- grants Permissions this tokens grants
This method returns JSON - delete Delete a single auth token by token.
ziggeo.authtokens().delete(token_or_key)
- create Create a new auth token.
ziggeo.authtokens().create(arguments = nil)
- volatile Will this object automatically be deleted if it remains empty?
- hidden If hidden, the token cannot be used directly.
- expiration_date Expiration date for the auth token (Unix epoch time format)
- usage_expiration_time Expiration time per session (seconds)
- session_limit Maximal number of sessions
- grants Permissions this tokens grants
This method returns JSONExample:require_relative "../lib/Ziggeo" app_token = ARGV[0]; private_key = ARGV[1]; ziggeo = Ziggeo.new(app_token, private_key) permissions = { session_owned: true } auth_token = ziggeo.authtokens.create(grants:{ create: permissions, read: permissions, update: permissions, destroy: permissions }.to_json) print auth_token
Ruby SDK Auth Methods
- generate Creates the encrypted auth token object that you can pass to your recorder
ziggeo.auth().generate(arguments = nil)
- volatile Will this object automatically be deleted if it remains empty?
- hidden If hidden, the token cannot be used directly.
- expiration_date Expiration date for the auth token (Unix epoch time format)
- usage_expiration_time Expiration time per session (seconds)
- session_limit Maximal number of sessions
- grants Permissions this tokens grants
This method returns string