Private App Authorization
Platform Type: Server/BOT (plan to surface MS BOT Framework in Glip)
Permissions: Glip, Read Contacts, Read Messages
I'm using the RingCentral Client C# SDK as shown on Github to authorize:
var oToken = await oRestClient.Authorize(cUserName, "", cPassword);
And I keep getting the same error: {"Call failed with status code 400 (Bad Request): POST https://developer.ringcentral.com also I can log into my RingCentral.com account with my credentials so why is authentication failing?
StackTtrace:
Message: Call failed with status code 400 (Bad Request): POST https://platform.devtest.ringcentral.com/restapi/oauth/token
StackTrace: at Flurl.Http.FlurlRequest.<HandleExceptionAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Flurl.Http.FlurlRequest.<SendAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Flurl.Http.FlurlRequest.<SendAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Flurl.Http.HttpResponseMessageExtensions.<ReceiveJson>d__0'1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RingCentral.RestClient.<Authorize>d__39.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter'1.GetResult()
at RESTAPI_Testing.Program.<Main>d__0.MoveNext() in ...Program.cs:line 53
Generally you should stick to Server/bot app type if you are building a bot. This is because, we provide never expire tokens for bot apps. So you can forget about bot token refresh.
2) More importantly can I add the Glip permission to my app
Yes, when you create the app, you can specify Glip permission (no matter what app type you choose). Can't you? Let me know if you have difficulty on this
3) Will I still be able to integrate it into Glip?
Yes I think so but as I said I think you should stick to Server/bot app type.
Why do you dislike Authorization Code "Authorization Flow type" ? Is there anything prevent you from using it?
1) Can this not be handled by the C# SDK?
Also, documentation states
Please note: Glip App (mobile or desktop) does NOT have:
support for the RingCentral Sandbox API (cannot switch to 'developer mode');
does not have a 'Sandbox version'
3) Also if I do not have an authentication/authorization server other that Glip right now do I even need an OAuth Redirect URI?
**A:** The error "unauthorized for grant type" occurs when your application is attempting to use an OAuth grant type that it is not approved to use. This often happens when your app requires the Authorization Code Flow but is attempting to use the Password Flow. See below for information in implementing Authorization Code Flow. For more information see [this Developer Community article](https://devcommunity.ringcentral.com/ringcentraldev/topics/unauthorized-for-this-grant-type-error).
**Q: How to deal with "Unauthorized for this grant type" issue?**
**A:** It probably means your app doesn't support password authorization flow. Please logon https://developer.ringcentral.com and confirm that your app has the following configuration: https://cloud.githubusercontent.com/assets/733544/18026560/b93e5356-6c7d-11e6-92a9-d35d28325e69.png
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