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
Properties
Claims
The custom claims.
public Dictionary<string, object> Claims { get; }
Property Value
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
Scope
The session's scope.
public string Scope { get; }
Property Value
SessionId
The session Id.
public string SessionId { get; }
Property Value
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
sessionIdstringThe session ID corresponding to the session to which the user will connect.
scopestringThe session's scope.
roleRoleThis 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.
claimsDictionary<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.