cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
815
Views
0
Helpful
0
Comments
Helmut Heise
Cisco Employee
Cisco Employee

Introduction

This document describe how to auto-generate the OAuth Token for Webex integrations without human intervention.

 

Requirements

  • Webex account and access to developer.webex.com
  • Cloud Instance or Server with public IP address and port 5007 open
  • Python 3    
  • Firefox

 

Lab Components

This guide is based in the following environment:

  • Azure Cloud Linux (almalinux 8.5) 
  • Python 3.6.8

 

Configuration

- Linux Terminal:

 

 

 

 

 

sudo yum -y update 
sudo yum -y install firefox git
pip3 install requests
pip3 install selenium
pip3 install flask
pip3 install pyopenssl

git clone https://github.com/hheisego/Webex-OAUTH.git

 

 

 

 

 

 

Download and unpack Selenium

in the root application folder:

 

 

 

 

 

wget https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz

tar -xf geckodriver-v0.30.0-linux64.tar.gz 

 

 

 

 

 

Create the integration

integration.jpg

 

redirect.jpg

scopes.jpg

values.jpg

Script Configuration

wbx-integration.py

 

 

 

import requests
from flask import Flask, render_template, request
import json

clientID = "C714b104c6dda60bbb378bb7e"
secretID = "4a8995bcb5b94f2ff782328afc"
redirectURI = "https://<your server ip or domain>:5007/oauth" 
...
if state == "HELMUT_STRING":

 

 

 

 

templates/index.html

 

 

 

<a id="grant1" href="https://webexapis.com/v1/authorize?client_id=C71e8ad2764e083bf8bcec19b9c89&response_type=code&redirect_uri=https%3A%2F%2Fyourdomain.online%3A5007%2Foauth&scope=spark-admin%3Abroadworks_subscribers_write%20meeting%3Aadmin_preferences_write%20spark%3Aall%20meeting%3Aadmin_preferences_read%20analytics%3Aread_all%20meeting%3Aadmin_participcompliance%3Arooms_write%20spark%3Aplaces_write&state=HELMUT_STRING">
<input type="button" id="grant-button" value="authorize it now">
</a>

 

 

 

 

autoken-refresh.py

 

 

 

browser.get('https://<your server ip or domain>:5007/')
...
get_token(webex_user="webexaccount@mailservice.com", password="webexpassword")

 

 

 

 

Verification

permisos.jpg

permisos2.jpg

 

 

 

Getting Started

Welcome to the Webex Community. This is your home to ask questions, share knowledge, and attend live webinars.