Socket
Socket
Sign inDemoInstall

byu-oauth

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

byu-oauth

Handles the OAuth2.0 flow for BYU APIs


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

byu-oauth

Handles the OAuth2.0 flow for BYU APIs

Examples

var OAuth = require("byu-oauth");

OAuth.getAccessToken(OAuth.grant_type.AUTHORIZATION_CODE, {
  client_id: /*client id*/,
  client_secret: /*client secret*/,
  code: /*authorization code*/,
  redirect_uri: /*redirect uri--where WSO2 redirected user after user validated your app*/
}).then(function (token) {
  
  //  use token here
  console.log(token);

}).catch(function (err) {
  
  //  handle error here
  console.error(err);
});

OAuth.getAccessToken(OAuth.grant_type.CLIENT_CREDENTIALS, {
  client_id: /*client id*/,
  client_secret: /*client secret*/
}).then(function (token) {
  
  //  use token here
  console.log(token);

}).catch(function (err) {
  
  //  handle error here
  console.error(err);
});

OAuth.getAccessToken(OAuth.grant_type.RESOURCE_OWNER, {
  client_id: /*client id*/,
  client_secret: /*client secret*/,
  password: /*password for NetID*/,
  username: /*NetID*/
}).then(function (token) {
  
  //  use token here
  console.log(token);

}).catch(function (err) {
  
  //  handle error here
  console.error(err);
});

OAuth.generateAuthorizationURL(OAuth.grant_type.AUTHORIZATION_CODE, /*client id*/, /*redirect uri*/)
.then(function (authorization_url) {
  
  //  use authorization URL here
  console.log(authorization_url);

}).catch(function (err) {
  
  //  handle error here
  console.error(err);
});

OAuth.generateAuthorizationURL(OAuth.grant_type.IMPLICIT, /*client id*/, /*redirect uri*/)
.then(function (authorization_url) {
  
  //  use authorization URL here
  console.log(authorization_url);

}).catch(function (err) {
  
  //  handle error here
  console.error(err);
});

Keywords

FAQs

Package last updated on 09 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc