question

Nick R avatar image
Nick R asked Nick R edited

Trying to migrate a Java application to JWT flow, getting "OAU-251 error - Unauthorized for this grant type"...

Hi!

I must migrate our Java fax application to jwt and I am currently getting "OAU-251 error - Unauthorized for this grant type" even though I seem to have done what appear to be a trivial change to the SDK to pass it the JWT instead of username and password.

I did not change the "auth" section of the application as it still need to work with the username and password in the Production environment until we are ready to replace it with the version of the application that supports JWT. Is this what is causing the problem?

Is there a solution to this problem or will the application in Production crash as soon as I switch from username and password to JWT?

By the way, why am I unable to answer "Do you intend to promote this app in the RingCentral App Gallery? *" and forced to publish our app if I want to submit the page?

Thank you!

Nick

fax
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered

When you change the JWT flow from a password flow app, the password flow will be disabled immediately, and normally the JWT token flow will take effect in about 5 mins. However, I have heard from some developers that they faced a longer time (up to hours). I cannot track those apps and found the root cause of the issue but it is quite rare.

Can you try again with your JWT token to see if it works now?

To your concern about the app in production, if you want to be very sure that the app will work continuously, please give me the app client id, I will enable the JWT and keep the password flow for you until we completely disable password flow.

If you are not sure about the question about prompting your app on the app gallery, just say no. You can provide the metadata and submit your app for listing on the app gallery later if you want.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Nick R avatar image
Nick R answered Nick R edited

Hi!

It does not make any difference, I still get the same error message.

But then from your answer I gather that it is normal right if I did not switch to JWT instead of password flow in the app configuration because I do not want to disrupt the app in Production.

I believe the app client id is NQn2UV38ShCUQbtSmF8Qlg, please do as you said and enable both flow please...

As for the question about publishing, the question is disabled so I cannot answer no and I am forced to fill in the fields when I submit because of this it seems...

Thank you and have a nice day!

Nick

6 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image Phong Vu ♦♦ commented ·

JWT flow is enabled for your app (NQn2UV38ShCUQbtSmF8Qlg). Password flow is also still enabled. Please change your code and use the JWT as soon as you can before the deadline.

Is this app (NQn2UV38ShCUQbtSmF8Qlg) the app you are talking about the promotion on the app gallery?

0 Likes 0 ·
Nick R avatar image Nick R Phong Vu ♦♦ commented ·

Thank you, it works now...

That app is in much need of love, it had not been touched in 4-5 years and was still using version 1.0.0 of your Java SDK...

Yes, it is the same app that I cannot set the promotion on the app gallery to off which seems to make mandatory filling in the gallery information.

Thank you very much and have a nice day and weekend!

Nick

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Nick R commented ·

If it's that app, I think the reason is that it's a private app and the type is server -only (no UI) app that cannot be published on the app gallery. I will check with the team to see what is really required.

0 Likes 0 ·
Show more comments

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys