iothub-auth
v0.0.3
Published
Generates Shared Access Keys to connect to Azure IoT Hub
Downloads
6
Readme
iothub-auth
Generates Shared Access Keys to connect to Azure IoT Hub from ES6 modules
api-versions support
IoT Hub has two authentication schemes:
- V1
getIoTHubV1Credentials
Used for classic hubs, usingapi-version=2020-09-30
- V2
getIoTHubV2Credentials
Used for classic hubs, usingapi-version=2021-06-30-preview
Usage
<script type="module">
import {getIoTHubV2Credentials} from 'https://unpkg.com/iothub-auth'
; (async ()=> {
const [username, password, websocket] = await getIoTHubV2Credentials(
'host',
'device',
'MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA=')
document.write(username,password)
})()
</script>