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
Trying to migrate a Java application to JWT flow, getting "OAU-251 error - Unauthorized for this grant type"...
Tags: fax
Feb 22, 2024 at 3:53pm   •   2 replies  •  0 likes
Nick R

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

2 Answers
answered on Feb 23, 2024 at 11:12am  

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


 0
on Feb 23, 2024 at 11:25am   •  0 likes

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?

on Feb 23, 2024 at 12:01pm   •  0 likes

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

on Feb 23, 2024 at 1:27pm   •  0 likes

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.

on Feb 23, 2024 at 5:04pm   •  0 likes

Thank you!

One more question, somewhat unrelated...

I am trying to improve the way the application deals with limits...

When sending faxes, does the "Auth" rate limit applies and are we talking of authenticating to send the fax using the application or something else?

Thank you and have a nice day and weekend!

Nick

on Feb 26, 2024 at 7:16am   •  0 likes

The /auth endpoint rate limit is 5 requests per 60 seconds. You should not call the /auth every time you call other platform APIs. Instead, you should use the refresh token to get a new access token (the access token expires after 1 hour) then call other APIs. The refresh token expires after 7 days and every time you refresh the tokens, you will get a new refresh token and it will be valid for another 7 days.

on Feb 26, 2024 at 10:57am   •  0 likes

I do not understand your answer...

That being said, what I think might possibly be included in "auth" is probably not as I sometimes call it more than 5 times per 60 seconds...

Our application was based off your example program and I saw no example of dealing with refresh tokens in Java.

It sound like the /auth endpoint rate limit is a concept and something only for OAuth while I am using JWT so I am not sure if it applies here...

I have never used OAuth, this might explain why I have trouble understand your answer...

Thank you

Nick

answered on Feb 22, 2024 at 4:34pm  

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.


 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