OAuth2.0 Loopback interface redirection

Created at 09 May 2021, 19:07
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
KE

Ketu

Joined 09.10.2018

OAuth2.0 Loopback interface redirection
09 May 2021, 19:07


I'm getting the following error after I allow access to my trading account:
Error authenticating application: Provided application does not contain provided URI.
Redirect URI in my application is http://127.0.0.1

This is the address my browser brings up to the spotware authorization page:
https://connect.spotware.com/apps/auth?&client_id={client_id}&redirect_uri=http%3A%2F%2F127.0.0.1%3A57113%2F&scope=accounts

I'm currently using a google sample app which asigns a random port
 

 

Any help will be greatly appreciated.


@Ketu
Replies

amusleh
10 May 2021, 08:39

Hi,

You have to add the Redirect URI on your Open API application Redirect URIs list first before trying to use the API authentication.

To add the redirect URI go to your applications page: https://connect.spotware.com/apps

Click on edit "Button" of your application and then add your redirect URI.


@amusleh

Ketu
10 May 2021, 22:39

RE:

amusleh said:

Hi,

You have to add the Redirect URI on your Open API application Redirect URIs list first before trying to use the API authentication.

To add the redirect URI go to your applications page: https://connect.spotware.com/apps

Click on edit "Button" of your application and then add your redirect URI.

I've added the http://127.0.0.1/xxxx to the app page but not sure about the syntax for a random port if it is possible


@Ketu

amusleh
11 May 2021, 08:36

RE: RE:

Hi,

You can use colon ":" to specify the port, and I recommend you to try our own samples:

Our WPF demo app sample has the trading account authentication.


@amusleh

Ketu
11 May 2021, 11:35

RE:

Ketu said:

 

I'm currently using a google sample app which asigns a random port
 

 

I've got it working using a specified port, but was wondering if it works with a random port. The previous sample app didn't have OAuth2.0, but I noticed the new app after I wrote the post so will have a look at it.


@Ketu