共用方式為


WebPubSubServiceClient.GetClientAccessUriAsync Method

Definition

Overloads

GetClientAccessUriAsync(TimeSpan, String, IEnumerable<String>, IEnumerable<String>, WebPubSubClientProtocol, CancellationToken)

Creates a URI with authentication token for the clients.

GetClientAccessUriAsync(DateTimeOffset, String, IEnumerable<String>, IEnumerable<String>, WebPubSubClientProtocol, CancellationToken)

Creates a URI with authentication token for the clients..

GetClientAccessUriAsync(TimeSpan, String, IEnumerable<String>, IEnumerable<String>, WebPubSubClientProtocol, CancellationToken)

Source:
WebPubSubServiceClient.cs

Creates a URI with authentication token for the clients.

public virtual System.Threading.Tasks.Task<Uri> GetClientAccessUriAsync (TimeSpan expiresAfter = default, string userId = default, System.Collections.Generic.IEnumerable<string> roles = default, System.Collections.Generic.IEnumerable<string> groups = default, Azure.Messaging.WebPubSub.WebPubSubClientProtocol clientProtocol = Azure.Messaging.WebPubSub.WebPubSubClientProtocol.Default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetClientAccessUriAsync : TimeSpan * string * seq<string> * seq<string> * Azure.Messaging.WebPubSub.WebPubSubClientProtocol * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Uri>
override this.GetClientAccessUriAsync : TimeSpan * string * seq<string> * seq<string> * Azure.Messaging.WebPubSub.WebPubSubClientProtocol * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Uri>
Public Overridable Function GetClientAccessUriAsync (Optional expiresAfter As TimeSpan = Nothing, Optional userId As String = Nothing, Optional roles As IEnumerable(Of String) = Nothing, Optional groups As IEnumerable(Of String) = Nothing, Optional clientProtocol As WebPubSubClientProtocol = Azure.Messaging.WebPubSub.WebPubSubClientProtocol.Default, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Uri)

Parameters

expiresAfter
TimeSpan

Defaults to one hour, if not specified. Must be greater or equal zero.

userId
String

User Id.

roles
IEnumerable<String>

Roles that the connection with the generated token will have.

groups
IEnumerable<String>

Groups that the connection with the generated token will join when it connects.

clientProtocol
WebPubSubClientProtocol

The client protocol.

cancellationToken
CancellationToken

Cancellation token.

Returns

Applies to

GetClientAccessUriAsync(DateTimeOffset, String, IEnumerable<String>, IEnumerable<String>, WebPubSubClientProtocol, CancellationToken)

Source:
WebPubSubServiceClient.cs

Creates a URI with authentication token for the clients..

public virtual System.Threading.Tasks.Task<Uri> GetClientAccessUriAsync (DateTimeOffset expiresAt, string userId = default, System.Collections.Generic.IEnumerable<string> roles = default, System.Collections.Generic.IEnumerable<string> groups = default, Azure.Messaging.WebPubSub.WebPubSubClientProtocol clientProtocol = Azure.Messaging.WebPubSub.WebPubSubClientProtocol.Default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetClientAccessUriAsync : DateTimeOffset * string * seq<string> * seq<string> * Azure.Messaging.WebPubSub.WebPubSubClientProtocol * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Uri>
override this.GetClientAccessUriAsync : DateTimeOffset * string * seq<string> * seq<string> * Azure.Messaging.WebPubSub.WebPubSubClientProtocol * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Uri>
Public Overridable Function GetClientAccessUriAsync (expiresAt As DateTimeOffset, Optional userId As String = Nothing, Optional roles As IEnumerable(Of String) = Nothing, Optional groups As IEnumerable(Of String) = Nothing, Optional clientProtocol As WebPubSubClientProtocol = Azure.Messaging.WebPubSub.WebPubSubClientProtocol.Default, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Uri)

Parameters

expiresAt
DateTimeOffset

UTC time when the token expires.

userId
String

User Id.

roles
IEnumerable<String>

Roles that the connection with the generated token will have.

groups
IEnumerable<String>

Groups that the connection with the generated token will join when it connects.

clientProtocol
WebPubSubClientProtocol

The client protocol.

cancellationToken
CancellationToken

Cancellation token.

Returns

Applies to