question

Mousa Khalil avatar image
Mousa Khalil asked Phong Vu answered

Can't login using code using python SDK

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

authenticationlog in
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Phong Vu avatar image
Phong Vu answered

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!

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys