Authorization framework standard that allows a user to grant a third-party web site or application access to the user's protected and control access to their applications and resources. In the OAuth2 flow, there are typically four parties involved: the user, the client (the application requesting access to the user's resources), the authorization server (responsible for authenticating the user and obtaining their consent), and the resource server (where the user's protected resources are stored).
The OAuth2 protocol works by using access tokens, which are issued by the authorization server after the user grants permission to the client. These access tokens are then presented to the resource server by the client to gain access to the protected resources on behalf of the user. This separation of authorization and resource servers allows for increased security, as the client never directly handles the user's credentials.
Requirements
-
Create an account in the portal web Webex for Developers https://developer.webex.com/.
-
Create your Webex Apps
- Create a virtual environment in python 3.9 +
- Store the variables as environment variable in your system Linux for clientID and secretID.
clientID = "Cb4268541f68984c205305cd19f1ecec03ca8d26f57230704771"
secretID = "2826a140ad33730e2ab787a44ca4c714d6cc4cb5896168"
- Take note about your redirect URI that is web page that cisco going to redirect after success authentication. The redirectURI variable, remplace the value in your code.
redirectURI = "http://127.0.0.1:2000/redirect.html"
- OAuth Authorization URL is used in the code index.py in the "oauthUrl" variable, remplace the value in your code.
Process in Linux:
devnet@PC1$ export secretID="2826a140ffe0643ee2ab787a44ca4c714d6cc4cb5896168" > ~/.bashrc
devnet@PC1$ export clientID="Cb4268541f6898e9e3142ec03ca8d26f57230704771" > ~/.bashrc
devnet@PC1$ source ~/.bashrc
(oauth) devnet@PC1$ echo $secretID
2826a140ffe0643eb3a5ad2244ad33730e2ab787a44ca4c714d6cc4cb5896168
(oauth) devnet@PC1$ echo $clientID
Cb4268541f68984c205305cd19f1ec4769fde9e3142ec03ca8d26f57230704771
- Activate Flask in your virtual environment and install the libraries listed in requirements.txt
devnet@PC1$ python3.10 -m venv oauth
devnet@PC1$ source oauth/bin/activate
devnet@PC1$ pip install -r requirements.txt
Figure. Cisco Live – DEVNET 2675
https://www.ciscolive.com/on-demand/on-demand-details.html?#/video/1687390798629001IngZ
oauth.mp4
-
Implementing OAuth 2.0 Authorization for Webex Integrations - DEVNET 2675
(https://www.ciscolive.com/on-demand/on-demand-details.html?#/video/1687390798629001IngZ)
-
Cisco Developer (https://developer.cisco.com/)