v16.3.0
Latest
2020.3+

Interface IVivoxTokenProvider

Must be implemented by the SetTokenProvider(IVivoxTokenProvider) caller. This object's responsibility is to provide an overridable implementation that will generate tokens for Vivox actions.

Namespace: Unity.Services.Vivox
Syntax
public interface IVivoxTokenProvider

Methods

GetTokenAsync(String, Nullable<TimeSpan>, String, String, String, String, String)

This async method should implement the necessary steps to providing a valid Vivox Access Token (VAT). After registration, this method will automatically be called whenever a token needs to be generated for a particular action. (e.g. login, channel join, mute).

Declaration
Task<string> GetTokenAsync(string issuer = null, TimeSpan? expiration = null, string targetUserUri = null, string action = null, string channelUri = null, string fromUserUri = null, string realm = null)
Parameters
TypeNameDescription
Stringissuer

Id of a title. Provided as part of the credentials delivered upon creating a project in the Unity Dashboard and enabling Vivox.

Nullable<TimeSpan>expiration

When the token should expire. By default, a 90 second expiration is used. When entering this into the expiration field of the token payload, use '(int)expiration.Value.TotalSeconds' to get the integer value in seconds. You may provide a custom expiration to your token payload but it must be relative to Unix epoch and the current time plus the desired expiration duration.

StringtargetUserUri

Id of the target for actions such as muting and blocking.

Stringaction

The action for which a token is requested. e.g.: "login", "join", ...

StringchannelUri

Id of the channel requesting the token.

StringfromUserUri

Id of the user requesting the token.

Stringrealm

Domain for which the token should be created.

Returns
TypeDescription
Task<String>

A Vivox token string.