Table of Contents

Struct TokenAdditionalClaims

Namespace
Vonage.Video.Authentication
Assembly
Vonage.dll

Represents additional claims for the Video Client's token.

public readonly struct TokenAdditionalClaims : IHasSessionId
Implements
Inherited Members

Fields

DefaultScope

Represents the default scope (session.connect).

public const string DefaultScope = "session.connect"

Field Value

string

Properties

Claims

The custom claims.

public Dictionary<string, object> Claims { get; }

Property Value

Dictionary<string, object>

Role

This defines the role the user will have. There are three roles: subscriber, publisher, and moderator. Subscribers can only subscribe to streams in the session (they cannot publish). Publishers can subscribe and publish streams to the session, and they can use the signaling API. Moderators have the privileges of publishers and, in addition, they can also force other users to disconnect from the session or to cease publishing. The default role (if no value is passed) is publisher.

public Role Role { get; }

Property Value

Role

Scope

The session's scope.

public string Scope { get; }

Property Value

string

SessionId

The session Id.

public string SessionId { get; }

Property Value

string

Methods

Parse(string, string, Role, Dictionary<string, object>)

Creates claims.

public static Result<TokenAdditionalClaims> Parse(string sessionId, string scope = "session.connect", Role role = Role.Publisher, Dictionary<string, object> claims = null)

Parameters

sessionId string

The session ID corresponding to the session to which the user will connect.

scope string

The session's scope.

role Role

This defines the role the user will have. There are three roles: subscriber, publisher, and moderator. Subscribers can only subscribe to streams in the session (they cannot publish). Publishers can subscribe and publish streams to the session, and they can use the signaling API. Moderators have the privileges of publishers and, in addition, they can also force other users to disconnect from the session or to cease publishing. The default role (if no value is passed) is publisher.

claims Dictionary<string, object>

The custom claims.

Returns

Result<TokenAdditionalClaims>

A success state with claims if the parsing succeeded. A failure state with an error if it failed.

ToDataDictionary()

Converts claims to a dictionary.

public Dictionary<string, object> ToDataDictionary()

Returns

Dictionary<string, object>

The claims dictionary.