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
Testing oAuth with PKCE
Tags: rest api, authentication
Feb 12, 2023 at 2:26pm   •   1 replies  •  0 likes
Matthew Skilton

Hi.


We have just finished a POC accessing the restapi with the Devtet account and the password flow and all works fine (authenticate with dev text username/p[assword in header and send a SMS). We just changed the app in the RingCentral Dev dashboard to be oAuth flow, and we trying to test it with our devtest account.. but it seems the exchanging the code for access token is erroring with the following error:

{
       
    "error""invalid_client",    
    "errors": [        
                  {
               
                      "errorCode""OAU-123",            
                      "message""Client authentication is required"        
                  }    
               ],    
    "error_description""Client authentication is required"
}


Can we not use our devtest account to confirm oAuth is working? If so what am I doing wrong. If not, how can we test the oAuth flow is working correctly before we publish this to production


We are using oAuth flow with PKCE as per this article

Authorization code flow with Proof Key for Code Exchange (ringcentral.com)

We are getting the above error on step 3

I am using ngrok for the callback tunnel.

additional.

Changing the flow to be just normal oAuth with no PKCE.. added the basic header with client id and client secret to the redeem code for token step, and removed the code_challenge, code_challene_method and code_verifier and it works fine now. If it is an issue with the hash being provided (the code_verifier) could the message be a bit more helpful.

I have also verified, given the example code_verifier and code_challenge on the docs page above, my code produces the same challenge from the same verifier.\

Is there a limit on the code_verifier on the RingCentral side, doesn't appear to mention anything in the docs. In the RFC, code_verifier is a minimum of 43 characters and a maximum of 128 characters. I am using the maximum of 128.

UPDATE:

I tried with 43 character code_verifier and same error



1 Answer
answered on Feb 13, 2023 at 9:44am  

Long story short, if your app authentication works successfully with code flow without the PKCA, and failed if you use the PKCA, then the problem could be in code challenge or how you set the headers and the body of your request.

With that, you will need to reveal some codes of your app and the best way to get help with such a situation is to open a support ticket and provide the info in the case.


 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