Question

OAU-251 - JWT - Unauthorized for this grant type

  • 12 November 2022
  • 2 replies
  • 828 views

Created JWT and trying to use this.


App I am using is the only App in Production for sending SMS.

Using Rest Client with C#


restClient = new RestClient(
                "RC_CLIENT_ID",
                "RC_CLIENT_SECRET",
                "https://platform.ringcentral.com");
var jwt = @"REMOVED FOR SECURITY";
var tokenInfo = await restClient.Authorize(jwt);
Response:
StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Server: nginx
  Date: Fri, 11 Nov 2022 23:44:07 GMT
  Connection: keep-alive
  Vary: Origin
  Vary: Access-Control-Request-Method
  Vary: Access-Control-Request-Headers
  RCRequestId: bbd807d0-621a-11ed-884a-0050568d7d0d
  Pragma: no-cache
  Cache-Control: no-store
  AceRoutingKey: iad41-c01-ace01-f7db789cc-xzsz9_10.120.155.210
  RoutingKey: SJC01P13
  Content-Type: application/json
  Content-Length: 201
  Content-Language: en
}
Content: {
  "error" : "unauthorized_client",
  "errors" : [ {
    "errorCode" : "OAU-251",
    "message" : "Unauthorized for this grant type"
  } ],
  "error_description" : "Unauthorized for this grant type"
}

Request:
Method: POST, RequestUri: 'https://platform.ringcentral.com/restapi/oauth/token', Version: 1.1, Content: System.Net.Http.FormUrlEncodedContent, Headers:
{
  X-User-Agent: Unknown/0.0.1 RingCentral.Net/5.18.0
  Authorization: Basic REMOVED FOR SECURITY
  traceparent: 00-e7fec9cf088e5a8849d254c03b4eea14-a20c80fc5b02ce2f-00
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 770
}
Content: grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=REMOVED-FOR-SECURITY

2 replies

Userlevel 1

What is the platform type of your app? Or what is the app client id?

Hi @Anand Patel, this could have something to do with your app settings, please submit a case here along with your client id

https://developers.ringcentral.com/support/create-case for further investigation on the error message.

Reply