Add new request ProtoOAOwnCtidAccessTokenReq

Created at 01 Jul 2024, 15:56
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!
BE

bennn

Joined 06.03.2019

Add new request ProtoOAOwnCtidAccessTokenReq
01 Jul 2024, 15:56


When using Open API to trade on your own account, you still need to use redirect URI logic using your own CTID and receive access and refresh tokens. The refresh token is replaced with a new one after you use it in the ProtoOARefreshTokenReq, which makes it complicated to use Open API to trade using your own accounts.

It would be much easier if there were a ProtoOAOwnCtidAccessTokenReq method that returns an AccessToken authorized for CTID, which created the app. This would allow traders to trade on their own accounts without all this redirect URI and refresh token:

  1. ProtoOAApplicationAuthReq → ProtoOAApplicationAuthRes
  2. ProtoOAOwnCtidAccessTokenReq → ProtoOAOwnCtidAccessTokenRes
  3. ProtoOAAccountAuthReq → ProtoOAAccountAuthRes

Could you check if it is possible to add it?


@bennn
Replies

PanagiotisCharalampous
01 Jul 2024, 18:13

Hi there,

If you are using your own accounts, then you can just obtain your token from the playground.  Then you can just refresh the token whenever needed. You don't need to implement any authentication logic in this case.

Best regards,

Panagiotis


@PanagiotisCharalampous

bennn
01 Jul 2024, 18:30

RE: Add new request ProtoOAOwnCtidAccessTokenReq

PanagiotisCharalampous said: 

Hi there,

If you are using your own accounts, then you can just obtain your token from the playground.  Then you can just refresh the token whenever needed. You don't need to implement any authentication logic in this case.

Best regards,

Panagiotis

When you refresh the token using ProtoOARefreshTokenReq, the old refresh token becomes obsolete. The new one returned in ProtoOARefreshTokenRes.refreshToken.
This means the refresh token is updated at least once a month. You need a way to store the latest refresh token in a centralized place. Otherwise, you can't launch your app from anywhere, e.g., on your PC and on a server or migrate to another server.


@bennn