Skip to main content

I have already implemented 3 legged authorization using c# in a startup.cs class which is working fine. Now I want I can send a login request when any user hits the APP controller then the request needs to be generated and the access token will return in the same controller after this I can show a view to the user where he can type Number and SMS then click on the send button.

So if anyone has a solution kindly help me or guide me on how I can do this.
Thanks

Please read this https://medium.com/ringcentral-developers/a-minimal-project-to-implement-ringcentral-auth-code-flow-in-javascript-bf995d458424

It's not C# but it's minimal. It's good for you to understand the whole flow. It's a single JS page, just like you want to do it in a single controller.


So in the controller code, you need to check wether there is query parameter named "code".

If yes, you exchange the code for access token and do whatever you want (send sms).

If no, you need to redirect user to the login URI, which can be generated using https://github.com/ringcentral/RingCentral.Net/tree/master/RingCentral.Net.AuthorizeUri

Be sure to set the redirect URI to the controller page, so that after user logged in, he will redirected back to you controller with "code" in query parameter.


Reply