News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Can't login using code using python SDK
Tags: log in, authentication
Jun 15, 2023 at 4:32am   •   1 replies  •  0 likes
Mousa Khalil

Can't login using code using python SDK. the 3 legged auth works fine and returns a code, but when I type platform.login("", "", CODE, REDIRECTLINK) it returns source not found.

Client ID = jfEaGJSpQgaMYwr8Q-O1Zg

Sandbox numebr = +12678284935

1 Answer
answered on Jun 15, 2023 at 8:06am  

Check the login function

def login(self, username='', extension='', password='', code='', redirect_uri='', jwt='', verifier=''):

Or look at the Dev guide getting started code

@app.route('/oauth2callback', methods=['GET'])
def oauth2callback():
    platform = rcsdk.platform()
    auth_code = request.values.get('code')
    try:
        platform.login('', '', '', auth_code, REDIRECT_URL)
    except:
        sys.exit("Unable to authenticate to platform. Check credentials.")
    tokens = platform.auth().data()
    session['sessionAccessToken'] = tokens
    return render_template('test.html')

The 'code' is the 4th param and the 'redirect_uri' is the 5th param!


 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us