Skip to content

MichaelJamesParsons/ustream-nodejs-oauth-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ustream Oauth Demo

This app demonstrates how to authenticate clients with Ustream's oauth API and the ustream nodejs sdk. Two oauth flows are featured in this demo:

Implicit flow Suitable for standalone, native clients (desktop / mobile). The user enters its credentials to a secure login webpage. After logging in, the browser is redirected to a special URL (defined by the client), passing the access token in the URL. -- Ustream Documentation

Authorization code flow Suitable for third-party websites which contain a client and a server component. The user enters its credentials to a secure login webpage. After logging in, the browser is redirected to a special URL (defined by the client), passing an authorization code in the URL. The third-party server obtains the access token with another HTTP request in the background, using the authorization code. This method is more secure than the implicit flow if the third-party client has a client+server model. See the OAuth2 Draft for details. -- Ustream Documentation

An example of the third type of flow, client credentials flow can be found in the ustream nodejs sdk readme. You can find more information about authentication flows in the official ustream docs.

Live Demo

View Demo

Installation

Install dependencies.

yarn install

Set environment variables.

USTREAM_CLIENT_ID - Your ustream client ID.
USTREAM_CLIENT_SECRET - Your ustream client secret.
USTREAM_REDIRECT_URI - https://yourdomain.com/channels

The value of USTREAM_REDIRECT_URI must exactly match the redirect uri you set when creating your Ustream API credentials.

This demo expects the user to be redirected to the /channels endpoint after logging in to their Ustream account.

Run the app

The app will run on port 3000. It must be hosted on a webserver that ustream can access (localhost will not work).

npm start

Using the app

Oauth Demo

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published