Skip to main content
Solved

Issues with Python & SMS demo app

  • 23 November 2022
  • 2 replies
  • 407 views

Hi folks,

I am juuuust getting started with RingCentral & Python, trying to run the sms.py sample app. I filled out .ENV as required, however, cannot run sms.py without error. I get the error:

Unable to authenticate to platform. Check credentials. Either code, or username with password, or jwt has to be provided

I have provided username, password, Client ID, etc. in .ENV and it is as if the script is ignoring it. I see a line of the script that says:

platform.login(jwt=os.environ.get('RC_JWT'))

which leads me to belive this sample .py file defaults to using JWT authentication? If so, how do I change it? If not, what might be wrong with my implementation?


Thank You!

2 replies

Userlevel 2
Badge

If you want to use username and password flow, you can define the username, password and extension number in your .env file and call the login method like this.

platform.login(os.environ.get('RC_USERNAME', os.environ.get('RC_EXTENSION', os.environ.get('RC_PASSWORD'))

We recommend developers to use JWT auth though.

Thank you sir, this was exactly what I was looking for. Just wanted to get a rough proof together before I dive into JWT :)

Reply