Comments (5)
I agree this should be added.
For reference, here is a demo app using authorization code with the SDK.
https://github.com/ringcentral/ringcentral-demos-oauth/tree/master/python-bottle
from ringcentral-python.
In other SDKs, such as Java, C#...etc. We provide two methods to facilitate authorization code flow:
authorize_uri(redirect_uri, state)
method returns an uri so that user could be redirected to this uri to start the authorization code flow.
authorize(auth_code = None, redirect_uri = None)
method exchanges the auth_code
for token.
It is good if this SDK could provide these two methods. So users don't have to do everything from scratch.
from ringcentral-python.
We have an escape latch for this: if you get the tokens you can set them directly via
sdk.platform().auth().set_data(data)
from ringcentral-python.
Providing better support for OAuth 2.0 Authorization Code flow is important because it is RingCentral's required OAuth flow for public apps and for all (public & private) Glip bots using the new bot provisioner (as requested in the OP). For websites, Authorization Code flow is a server-based flow designed for languages like Python, e.g. using Django. RingCentral also uses it for Glip bots now.
As mentioned, this support is in RingCentral's other official SDKs, including JavaScript, C#, Java, etc. In JavaScript, the Authorization Code is designed for server-based apps such as Node.js / Express apps, similar to the Python / Django use case here. Here is a RingCentral tutorial for server-side JavaScript which uses the Auth Code support:
https://github.com/ringcentral-tutorials/oauth-nodejs-demo
Since it was mentioned in a side conversation, client-side JavaScript apps are meant to use Implicit Grant flow as per the OAuth 2.0 RFC:
https://tools.ietf.org/html/rfc6749#section-1.3.2
The implicit grant is a simplified authorization code flow optimized for clients implemented in a browser using a scripting language such as JavaScript.
Here is a RingCentral tutorial on using Implicit Grant:
https://github.com/ringcentral-tutorials/oauth-implicit-js-demo
In addition to the example Python / Bottle code I created and posted above using this SDK, built-in Python authorization code support similar to our other official SDKs is available in this community Python SDK for reference:
https://github.com/tylerlong/ringcentral-python
from ringcentral-python.
Fixed in 0.7.8
from ringcentral-python.
Related Issues (20)
- TypeError: not a valid non-string sequence or mapping object HOT 1
- Need a simple and documented way to set auth token
- Install Failing - pip install ringcentral on Python 3.8.1 HOT 1
- Can we get a sample Credentials.ini file that could be used. HOT 1
- Using the SDK in background tasks
- pip 2.7 doesn't work HOT 1
- how set a parameter in SDK builder to not send coverpage HOT 1
- issue with fax attachments in sandbox with python SDK HOT 1
- Do not specify default "Accept" header HOT 1
- CloudQuery RingCentral Plugin?
- error sending fax HOT 4
- Receiving this error while running platform_test.py HOT 1
- move demo code to a folder
- how to get mms attachment need a demo
- WebSocket must heartbeat HOT 1
- Github release tags appear out of date
- Script Information
- 400 error trying to delete extesnion. This Delete Extension requires a body. HOT 1
- Please move pdoc to requirements-dev.txt
- ApiException: Access token is expired / 401 error in long-running scripts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ringcentral-python.