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
How call 3 legged Authorization request From APP Controller (Asp.net core) and get access token in same controller
Tags: ringcentral app
Dec 2, 2021 at 4:02am   •   1 replies  •  0 likes
Benny Dadon

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

1 Answer
answered on Dec 2, 2021 at 10:29am  

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.


 1



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