I am attempting to convert from using application wide credentials for using the RingOut api to using individual user authentication, and I am running into two particular errors:
When using the RingCentral.Net v5.8.0 (+ RingCentral.Net.AuthorizeUri v1.0.0), the following code throws a NullReferenceException inside of RestClient.Request:
using (var rc = new RestClient(config.ClientId, config.ClientSecret, RestClient.SandboxServer))
{
var redirectUri = config.RedirectUri;
var loginLocation = await rc.Restapi().Oauth().Authorize().Post(
new AuthorizeRequest()
{
response_type = "code",
client_id = rc.clientId,
redirect_uri = redirectUri,
});
}
Stack trace:
at RingCentral.RestClient.<Request>d__31.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at RingCentral.RestClient.<Request>d__2.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at RingCentral.RestClient.<Request>d__3`1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at RingCentral.RestClient.<Post>d__5`1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at RingCentral.Paths.Restapi.Oauth.Authorize.Index.<Post>d__4.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
I have attempted to perform the same action using Postman, with a request looking like:
POST https://platform.devtest.ringcentral.com/restapi/v1.0/oauth/authorize
Authorization: Basic <"ClientId:ClientSecret" in Base64Url encoding>Content-Type: application/x-www-form-urlencoded
response_type = code
client_id = <Client Id>
redirect_uri = <the same redirect uri>
But this constantly results in a HTTP 404 response:
{
"errorCode": "AGW-404",
"message": "Resource not found",
"errors": u]
}