question

darshan-gondaliya avatar image
darshan-gondaliya asked ·

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.
topic-default
1 |1000 characters needed characters left characters exceeded

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 devsupport@ringcentral.com with the necessary details and the team would add it.



Share
1 |1000 characters needed characters left characters exceeded

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

darshan-gondaliya avatar image
darshan-gondaliya answered ·
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 Share
1 |1000 characters needed characters left characters exceeded

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. 
Share
1 |1000 characters needed characters left characters exceeded

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

Share
1 |1000 characters needed characters left characters exceeded

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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