Compartilhar via


ClientAuthenticationWithTokenRefresh(String, String, TimeSpan, Int32) Construtor

Definição

Cria uma instância dessa classe.

public ClientAuthenticationWithTokenRefresh (string deviceId, string moduleId = default, TimeSpan suggestedTimeToLive = default, int timeBufferPercentage = 0);
new Microsoft.Azure.Devices.Client.ClientAuthenticationWithTokenRefresh : string * string * TimeSpan * int -> Microsoft.Azure.Devices.Client.ClientAuthenticationWithTokenRefresh
Public Sub New (deviceId As String, Optional moduleId As String = Nothing, Optional suggestedTimeToLive As TimeSpan = Nothing, Optional timeBufferPercentage As Integer = 0)

Parâmetros

deviceId
String

Identificador do dispositivo.

moduleId
String

Identificador de módulo.

suggestedTimeToLive
TimeSpan

O valor de vida útil sugerido para os tokens SAS gerados. O valor padrão é de 1 hora.

timeBufferPercentage
Int32

O buffer de tempo antes da expiração quando o token deve ser renovado, expresso como uma porcentagem do tempo de vida útil. O comportamento padrão é que o token será renovado quando tiver Microsoft.Azure.Devices.Client.ClientAuthenticationWithTokenRefresh.DefaultSasRenewalBufferPercentage porcentagem ou menos de seu tempo de vida restante.

Exceções

Lançado quando deviceId é nulo.

Gerado quando deviceId ou moduleId está vazio ou espaço em branco.

Gerado se suggestedTimeToLive for um período negativo ou se timeBufferPercentage estiver fora do intervalo de 0 a 100.

Aplica-se a