Giter Site home page Giter Site logo

drkchiloll / webexteams-guestissuer Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 12 KB

Programmatically generate Persistent Guests for Webex Teams, SDKs and Widgets: https://developer.webex.com/guest-issuer.html

License: MIT License

TypeScript 100.00%

webexteams-guestissuer's Introduction

Webex Teams Guest Issuer Programmatic AuthToken Generator

This is a module that issues Webex Teams Authorization Tokens for Guest Issuer App Users that allow Guests to persistently use Webex Teams throught the Teams SDKs and Widgets within your application logic. If you want to generate tokens from the CLI refer to Steve Sfartz repository here. To use the Guest Issuer Service you must first have a Webex Teams Paid account and create a Guest Issuer Application from the Webex for Developers portal.

Installation

npm install -s webexteams-guestissuer

Usage

const { SparkGuest } = require('webexteams-guestissuer');
const guest = new SparkGuest({
  id: 'GuestAppId generated from the DEV Portal',
  secret: 'GuestSecret generated from the DEV Portal'
});
// Generates a Unique ID for the User
const guestId = guest.generateId();
guestIssuer.generateJwt({
  userid: guestId,
  displayName: 'MyGuestUser'
}).then(jwt => {
  // guestIssuer.jwtToken = the Generated JWT for use to obtain AuthToken
  guest.retreiveAccessToken(jwt)
    .then(authData => {
      /**
       * AuthData <Object>
       * AuthData.token <String>
       * AuthData.expiresIn <Number>
       * AuthData.formattedExpiration <UTC Formatted DataTime>
       */
      // Uses the people/me Webex Teams Endpoint
      guestIssuer.getGuest(authData.token).then(loggedInUser => {
        //{ id, emails, displayName, orgId, type: "appuser", created, avatar }
      })
    })
}).catch(error => 'Something Went Wrong');

Contributing and/or Fork

This module is written using Typescript. Clone this Module to submit PRs or continue development as your own repository.

npm install
# To Build for PROD
npm run build
# Development (watches all ts files in the src directory and builds on change
npm run dev

License

MIT

webexteams-guestissuer's People

Contributors

drkchiloll avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.