Skip to main content
local728
The First Step
The First Step
April 15, 2025
Solved

oau-250 Error with JWT authentication flow

I am getting the OAU-250 error when attempting the JWT Authentication Flow. I am basically using CURL to attempt this. The curl options are:

"–X POST -D \"\" --header \"Accept: application/json\" --header \"Content-Type: application/x-www-form-urlencoded\" --header \"Authorization: Basic " & $basic  & "\" --data " & $data

 

$basic is a base64 encoded combo of clientID:clientSecret

$data is "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=" & $jwt

$jwt is the jwt value we received in the rc_credentials.json file for the application.

 

The app is private and is configured for JWT auth flow and issue refresh tokens is set to Yes. The application scope is set to read accounts and ringout.

What am I missing?

local728
local728Answer
The First Step
April 18, 2025

It worked on the Mac, so I researched the differences of curl on a Mac and Windows and found the solution. On a Mac/Linux machine. you enclose the parameters with ‘. On a Windows machine, you enclose the parameters with “. Also of note on Windows, if you run from PowerShell, curl is now aliased to Invoke-WebRequest, so if you want to use curl, you need to call curl.exe. Hope this post helps save someone else a lot of time :-)

So in the end, the command, on Windows needs to be:

curl -request POST 
--header "Accept: application/json" 
--header "Content-Type: application/x-www-form-urlencoded" 
--header "Authorization: Basic XYZABC=="
--data "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=eXYZABZQ" 
--url "https://platform.ringcentral.com/restapi/oauth/token"

I am now working :-)

13 replies

PhongVu
Community Manager
Community Manager
April 18, 2025

Sorry, that was a typo. Checking the code it is (xxxxxxxWD:XXXXXXXXv4). That results in an encoded string staring with M2 and ending with NA==. I have done the conversion using multiple tools and get the same result.

If all the credentials are correct and you still cannot get authenticated. I can only think that something is not correct in your curl or environment.

Clone this PHP project and try with the code. Or download any RingCentral SDK to try.

local728
The First Step
local728Author
The First Step
April 18, 2025

I’m doing it on Windows - I have a Mac I can try it on and see if I get different results. I’ll report back.

local728
The First Step
local728AuthorAnswer
The First Step
April 18, 2025

It worked on the Mac, so I researched the differences of curl on a Mac and Windows and found the solution. On a Mac/Linux machine. you enclose the parameters with ‘. On a Windows machine, you enclose the parameters with “. Also of note on Windows, if you run from PowerShell, curl is now aliased to Invoke-WebRequest, so if you want to use curl, you need to call curl.exe. Hope this post helps save someone else a lot of time :-)

So in the end, the command, on Windows needs to be:

curl -request POST 
--header "Accept: application/json" 
--header "Content-Type: application/x-www-form-urlencoded" 
--header "Authorization: Basic XYZABC=="
--data "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=eXYZABZQ" 
--url "https://platform.ringcentral.com/restapi/oauth/token"

I am now working :-)