Skip to main content
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

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


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>")




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 )


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?



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


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


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?



Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings