@toolkitx/microsoft-stream-auth
v0.0.3
Published
A temporary, light-weight, high-performance solution to get access token of Microsoft Stream without any browser technologies like Chrome/Selenium.
Downloads
8
Readme
@toolkitx/microsoft-stream-auth
A temporary, light-weight, high-performance solution to get access token of Microsoft Stream without any browser technologies like Chrome/Selenium.
Why you need this? Accroading to the Office 365 roadmap, Microsoft doesn't provide any public APIs to access the Stream videos event you add API permissions to your app. So with the token get by microsoft-stream-auth
, you can access the internal API of Stream, like upload video, download video etc.
How it works
The microsoft-stream-auth
go through the login flow by sending HTTP requests. It means it might not work in the feature.
Installation
npm install @toolkitx/microsoft-stream-auth
Simple to use
const streamAuth = require('@toolkitx/microsoft-stream-auth');
const result = await streamAuth({account: 'User Account', pwd: 'User Password'});
Then you will get below object:
{
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dC....",
"apiGatewayUri": "https://aaea-1.api.microsoftstream.com/api/",
"apiGatewayVersion": "1.3-private",
"accessTokenExpiry": "2019-12-09T08:19:25.6166735+00:00"
}
How to run test
- Set your account and password in test/config.js
- Run below command:
npm test