Giter Site home page Giter Site logo

webex-teams-oauth's Introduction

Webex Teams integration using Requests_OAuthlib and the WebexTeamsSDK

A simple python Flask application that uses the Webex Teams OAuth 2 authentication flow to log in a user and return their last 10 active spaces.

How to setup the application

  1. Install ngrok to expose the Flask application

  2. Open a new console window and start ngrok to expose port 5000 of your local machine to the internet

cd <directory where ngrok executable is located>
./ngrok http 5000
  1. Configure a new integration from the Cisco Webex for Developers integration creation page
  • Enter the name of your integration

  • Enter a contact email

  • Pick an icon

  • Give your integration a description

  • Enter the Redirect_URI

    Use the ngrok https forwarding uri and append /callback to the end

    ex. https://fh47sk3u.ngrok.io/callback

    Note: You will need this Redirect_URI for the application setup later. If you close ngrok and start it again the random https URI will change and you will have modify it in the integration.

  • Select the spark:all scope

  • Click the "Create Integration" button

  1. After the integration is created save the Client ID and Client Secret somewhere secure for later use in the Flask app configuration

    The Client Secret will only be shown once so please copy and keep it safe! You can always regenerate it, but you will not see this one again.

  2. Clone the repository and setup the application environment From a bash shell:

git clone https://github.com/CiscoSE/teams-oauth-flask
cd teams-oauth-flask
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt 
  1. Edit the _config.py file to add the Client ID, Client Secret and Redirect_URI
CLIENT_ID = ''        #Copy the Client ID from your integration here
CLIENT_SECRET = ''    #Copy the Client Secret from your integration here
AUTHORIZATION_BASE_URL = 'https://api.ciscospark.com/v1/authorize'
TOKEN_URL = 'https://api.ciscospark.com/v1/access_token'
SCOPE = 'spark:all'
REDIRECT_URI = 'https://<ngrok https URI>/callback'   #Copy your active ngrok https URI + /callback

How to run

From a bash shell:

python3 oauth.py

How to test

  1. Open a browser and go to your active ngrok https URI

    ex. https://fh47sk3u.ngrok.io

    You should be redirected to the Webex Teams authentication page and upon successful login a list of the last 10 active spaces should be displayed

webex-teams-oauth's People

Contributors

hbill75 avatar

Stargazers

shbnq422 avatar

Watchers

James Cloos 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.