您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

IotEdgeAuthenticationProvider class

Provides an AuthenticationProvider implementation that delegates token generation to iotedged. This implementation is meant to be used when using the module client with Azure IoT Edge. This type inherits from SharedAccessKeyAuthenticationProvider and is functionally identical to that type except for the token generation part which it overrides by implementing the _sign method.

Extends

Properties

type

Methods

fromConnectionString(string, number, number)

Creates a new SharedAccessKeyAuthenticationProvider from a connection string

getDeviceCredentials()

This method is used by the transports to gets the most current device credentials in the form of a TransportConfig object.

getDeviceCredentials(Callback<TransportConfig>)

This method is used by the transports to gets the most current device credentials in the form of a TransportConfig object.

getTrustBundle((err?: Error, ca?: string) => void)
stop()

Stops the timer used to renew to SAS token.

Property Details

type

type: AuthenticationType

Property Value

AuthenticationType

Method Details

fromConnectionString(string, number, number)

Creates a new SharedAccessKeyAuthenticationProvider from a connection string

static function fromConnectionString(connectionString: string, tokenValidTimeInSeconds?: number, tokenRenewalMarginInSeconds?: number)

Parameters

connectionString
string

A device connection string containing the required parameters for authentication with the IoT hub.

tokenValidTimeInSeconds
number

The number of seconds for which a token is supposed to be valid.

tokenRenewalMarginInSeconds
number

The number of seconds before the end of the validity period during which the SharedAccessKeyAuthenticationProvider should renew the token.

Returns

getDeviceCredentials()

This method is used by the transports to gets the most current device credentials in the form of a TransportConfig object.

function getDeviceCredentials()

Returns

Promise<TransportConfig>

getDeviceCredentials(Callback<TransportConfig>)

This method is used by the transports to gets the most current device credentials in the form of a TransportConfig object.

function getDeviceCredentials(callback: Callback<TransportConfig>)

Parameters

callback
Callback<TransportConfig>

getTrustBundle((err?: Error, ca?: string) => void)

function getTrustBundle(callback: (err?: Error, ca?: string) => void)

Parameters

callback
(err?: Error, ca?: string) => void

stop()

Stops the timer used to renew to SAS token.

function stop()