Giter Site home page Giter Site logo

alexdt1982 / microsoft-stream-auth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zackallen1/microsoft-stream-auth

0.0 0.0 0.0 304 KB

A temporary, light-weight, high-performance solution to get access token of Microsoft Stream without any browser technologies like Chrome/Selenium.

License: MIT License

JavaScript 100.00%

microsoft-stream-auth's Introduction

@toolkitx/microsoft-stream-auth

CIStatus npm version

A temporary, light-weight, high-performance solution to get a Microsoft Stream access token without any browser technologies like Chrome/Selenium.

Why would you need this?

According to the Office 365 Roadmap, Microsoft doesn't provide any public APIs to access the Stream videos even if you add API permissions to your app. So with the token gathered by microsoft-stream-auth, you can access the internal API of Stream like uploading videos, downloading videos, etc.

Demo

How it works

The microsoft-stream-auth goes through the login process by sending HTTP requests to login.microsoftonline.com

โš ๏ธ WARNING: By using HTTP Requests, this does not guarantee that this tool will work in the future. If this tool is currently broken please submit an issue.

Installation

Option 1 (Install the Package)

npm install @toolkitx/microsoft-stream-auth

Create a config.js file in the same directory as the installed package with the following code

module.exports = {
    account: '<insert account email here>',
    pwd: '<insert account password here>'
}

Then, create an index.js file also in the same directory with the following code

const cred = require('./config');
const login = require('@toolkitx/microsoft-stream-auth');

(async () => {
    const token = await login(cred);
    console.log(token);
})();

Finally, run the code with

node index.js

Option 2 (Clone the Repo)

git clone https://github.com/toolkitx/microsoft-stream-auth.git
cd microsoft-stream-auth
npm install

Add your account email and password to test/config.js, then run the following command

npm run test

In both installation cases you should get an object similar to the following if successful

{
    "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dC....",
    "apiGatewayUri": "https://aaea-1.api.microsoftstream.com/api/",
    "apiGatewayVersion": "1.3-private",
    "accessTokenExpiry": "2019-12-09T08:19:25.6166735+00:00"
}

Enjoy!

microsoft-stream-auth's People

Contributors

hwangzhiming avatar zackallen1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.