Skip to main content
The First Step
June 25, 2019
Question

OAuth2 Getting Invalid Client ID

When using the RC dev OAuth server I get "Invalid Client_ID" when I try to authenticate.

I am using the Client ID from my app

Do I need to encode this in anyway? If so how would I encode this in Python 3 lets say?

I have tried using base64 lib with no luck

8 replies

The First Step
June 25, 2019

Yes for getting token you need to encode both client Id and client secret in base64 format in Authorization header in normal API call as follows:

Authorization: Basic <clientId:client secret in base64>

Here are several examples of how to use Authorization Flow in a variety of languages: https://github.com/grokify/ringcentral-demos-oauth

Also oauth url should be http POST

The First Step
June 25, 2019

Are the < and > needed?

I am creating a http get and passing the Client_ID parameter

What is the exact string I need to encode for the parameter in my get?


Client_ID =base64encode("Authorization: Basic <clientId:client secret>")



The First Step
June 25, 2019

Header should be named Authorization and the value will be :

Basic client id: client secret ( here client I'd +client secret value with colon in base64 )

The First Step
June 25, 2019

should I follow:

https://developers.ringcentral.com/api-reference/Authorization


Do I need any params (i.e. client_id, response_type, redirect_uri, brand_id, state, prompt) or is the "Authorization" : "Basic base64encode(client-ID:client-secret)" header only needed?


The First Step
June 25, 2019

Yes you need to pass the parameters as well . But check which type of Authorization your application follows.. is it Authorization code or password flow.. based on that the parameters and oauth url will change

The First Step
June 25, 2019

I am trying to use the Python API

https://github.com/ringcentral/ringcentral-python

Any pointers here - I do see an internal function for this purpose Platform._request_token but haven't been able to get it to work

I am using Authorization code

The First Step
June 26, 2019

So it turns out I had a typo in the Client ID and now I am past this error.


I do have one followup question. Where do I get the "Application code grant" code to put into the post?


Does the /restapi/oauth URI on the dev portal have the ability to provide this?