你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ModuleAuthenticationWithTokenRefresh 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
ModuleAuthenticationWithTokenRefresh(String, String) |
使用默认 TTL 和 TTL 缓冲区时间设置初始化此类的新实例。 |
ModuleAuthenticationWithTokenRefresh(String, String, Int32, Int32) |
初始化此类的新实例。 |
ModuleAuthenticationWithTokenRefresh(String, String, Int32, Int32, Boolean) |
初始化此类的新实例。 |
ModuleAuthenticationWithTokenRefresh(String, String)
使用默认 TTL 和 TTL 缓冲区时间设置初始化此类的新实例。
public ModuleAuthenticationWithTokenRefresh (string deviceId, string moduleId);
new Microsoft.Azure.Devices.Client.ModuleAuthenticationWithTokenRefresh : string * string -> Microsoft.Azure.Devices.Client.ModuleAuthenticationWithTokenRefresh
Public Sub New (deviceId As String, moduleId As String)
参数
- deviceId
- String
设备的 ID。
- moduleId
- String
模块的 ID。
注解
此构造函数将创建一个身份验证方法实例,该实例在释放其关联的模块客户端实例时将被释放。 若要跨多个客户端实例生存期重复使用身份验证方法实例,请使用 ModuleAuthenticationWithTokenRefresh(String, String, Int32, Int32, Boolean) 构造函数并将 设置为 disposeWithClient
false
。
适用于
ModuleAuthenticationWithTokenRefresh(String, String, Int32, Int32)
初始化此类的新实例。
public ModuleAuthenticationWithTokenRefresh (string deviceId, string moduleId, int suggestedTimeToLiveSeconds, int timeBufferPercentage);
new Microsoft.Azure.Devices.Client.ModuleAuthenticationWithTokenRefresh : string * string * int * int -> Microsoft.Azure.Devices.Client.ModuleAuthenticationWithTokenRefresh
Public Sub New (deviceId As String, moduleId As String, suggestedTimeToLiveSeconds As Integer, timeBufferPercentage As Integer)
参数
- deviceId
- String
设备 ID。
- moduleId
- String
模块 ID。
- suggestedTimeToLiveSeconds
- Int32
生成的 SAS 令牌的建议生存时间值。 默认值为 1 小时。
- timeBufferPercentage
- Int32
到期前应续订令牌的时间缓冲区,以生存时间的百分比表示。 默认行为是,当令牌的生存期还剩 15% 或更少时,将续订令牌。
注解
此构造函数将创建一个身份验证方法实例,该实例在释放其关联的模块客户端实例时将被释放。 若要跨多个客户端实例生存期重复使用身份验证方法实例,请使用 ModuleAuthenticationWithTokenRefresh(String, String, Int32, Int32, Boolean) 构造函数并将 设置为 disposeWithClient
false
。
适用于
ModuleAuthenticationWithTokenRefresh(String, String, Int32, Int32, Boolean)
初始化此类的新实例。
public ModuleAuthenticationWithTokenRefresh (string deviceId, string moduleId, int suggestedTimeToLiveSeconds, int timeBufferPercentage, bool disposeWithClient);
new Microsoft.Azure.Devices.Client.ModuleAuthenticationWithTokenRefresh : string * string * int * int * bool -> Microsoft.Azure.Devices.Client.ModuleAuthenticationWithTokenRefresh
Public Sub New (deviceId As String, moduleId As String, suggestedTimeToLiveSeconds As Integer, timeBufferPercentage As Integer, disposeWithClient As Boolean)
参数
- deviceId
- String
设备 ID。
- moduleId
- String
模块 ID。
- suggestedTimeToLiveSeconds
- Int32
生成的 SAS 令牌的建议生存时间值。 默认值为 1 小时。
- timeBufferPercentage
- Int32
到期前应续订令牌的时间缓冲区,以生存时间的百分比表示。 默认行为是,当令牌的生存期还剩 15% 或更少时,将续订令牌。
- disposeWithClient
- Boolean