ClientAuthenticationWithTokenRefresh(String, String, TimeSpan, Int32) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an instance of this class.
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)
Parameters
- deviceId
- String
Device identifier.
- moduleId
- String
Module identifier.
- suggestedTimeToLive
- TimeSpan
The suggested time to live value for the generated SAS tokens. The default value is 1 hour.
- timeBufferPercentage
- Int32
The time buffer before expiry when the token should be renewed, expressed as a percentage of the time to live. The default behavior is that the token will be renewed when it has Microsoft.Azure.Devices.Client.ClientAuthenticationWithTokenRefresh.DefaultSasRenewalBufferPercentage percent or less of its lifespan left.
Exceptions
Thrown when deviceId
is null.
Thrown when deviceId
or moduleId
is empty or whitespace.
Thrown if suggestedTimeToLive
is a negative timespan, or if timeBufferPercentage
is outside the range 0-100.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應