iothub-auth

0.0.3 • Public • Published

iothub-auth

Generates Shared Access Keys to connect to Azure IoT Hub from ES6 modules

Node.js CI

api-versions support

IoT Hub has two authentication schemes:

  • V1 getIoTHubV1Credentials Used for classic hubs, using api-version=2020-09-30
  • V2 getIoTHubV2Credentials Used for classic hubs, using api-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>

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    1
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i iothub-auth

Weekly Downloads

1

Version

0.0.3

License

ISC

Unpacked Size

7.34 kB

Total Files

6

Last publish

Collaborators

  • ridomin