IoTHubTokenCredentials class
Creates shared access signatures based on the connection string passed to the constructor. This class is used by the protocol layer of the SDK to add authentication headers to each request.
Constructors
Io |
Methods
get |
Gets the Azure IoT Hub instance name from the connection string |
sign |
Adds an authorization header to the request object. |
Constructor Details
IoTHubTokenCredentials(string)
new IoTHubTokenCredentials(connectionString: string)
Parameters
- connectionString
-
string
Method Details
getHubName()
Gets the Azure IoT Hub instance name from the connection string
function getHubName(): string
Returns
string
signRequest(WebResource)
Adds an authorization header to the request object.
function signRequest(webResource: WebResource): Promise<WebResource>
Parameters
- webResource
- WebResource
The request object that needs its authorization header populated
Returns
Promise<WebResource>