question

darshan-gondaliya5798 avatar image
darshan-gondaliya5798 asked Adam Martinez answered

I want to add dynamic OAuth Redirect URL

I want to add the App for get Call details in my magento 1.7.2 site. I want to add this functionality in admin panel. admin has dynamic url in customer module. then how to i add OAuth Redirect URI.

authentication
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

ak avatar image
ak answered

You should be able to add one or more OAuth RedirectURI's into your application during development ( Sandbox ).

Please Login to the Developer Portal and click on the application:

Head over to Settings -> OAuth Settings you should be able to add the redirectUri


For any OAuth Redirect URI additions into the application once the app has been approved for Production, please send out an email to the developer support team or submit a support ticket with the necessary details and the team would add it.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

darshan-gondaliya5798 avatar image
darshan-gondaliya5798 answered John Wang commented
You are not getting my point. I know i can add the url there but my url has one random key associated. it will be change every time so how can i add url with dynamic generated key ?
1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

To add a random key, what is typically done is to add a 'state' query parameter to the Authorization URL. When this is done the 'state' parameter with the same value will be passed back to the Redirect URI. The state parameter does not have to be added to your Redirect URI endpoint in the Developer Portal.

You can read more about the state parameter in the OAuth spec here:

https://tools.ietf.org/html/rfc6749#section-4.1.1

You can see an example of this in the Ruby Sinatra OAuth 2.0 demo:

Pass in the state parameter
auth_url = client.authorize_url(state: state)
https://github.com/ringcentral/ringcentral-demos-oauth/blob/master/ruby-sinatra/app.rb#L25

Retrieve the state parameter parameter paramter in your Redirect URI
state = params.key?('state') ? params['state'] : ''
https://github.com/ringcentral/ringcentral-demos-oauth/blob/master/ruby-sinatra/app.rb#L32
1 Like 1 ·
ak avatar image
ak answered
Hi Darshan,

Sorry, my bad I did not understand the question. I guess the usage of Wildcards will solve the purpose for you. 

Below is an example of how to use wildcards:

Let's say your redirectURI looks like this:

http://localhost:8080/callback.php

You could add the redirectUri on your application as:

http://localhost:*/callback.php

Let us know if you still have any issues using the Wildcards within the redirectURI. 
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Adam Martinez avatar image
Adam Martinez answered

Wildcards are not allowed in the OAuth Redirect URI

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys