10

I'm trying to create a web server that allow users to oauth their IB accounts. To obtain a request token, you first need to get a consumer key. I tried to follow their instruction, but there is no details on how to make a call to get the consumer_key.

What exactly should the endpoint be? Is it a POST or GET call? how do params / body looks like?

enter image description here

Yumiko
  • 448
  • 5
  • 16

7 Answers7

5

I'm getting 501 HTTP error, it seems that OAuth is not ready yet for InteractiveBrokers developers:

Direct link to the OAuth configuration: https://www.interactivebrokers.co.uk/oauth

enable-oauth-access-

Rdey
  • 420
  • 6
  • 9
3

Even though you registered your consumer_key in InteractiveBroker settings page, OAuth flow for the consumer_key will not be worked because IB Web API OAuth flow is not ready to work. Their customer service doesn't have the ability to solve the problem because the OAuth flow should be ready by the developers for IB Service Provider.

All of documents for the OAuth flow of InteractiveBroker is not correct and the customer service said they don't know about the issues.

It will be the losing of the time if you are going to solve the problem for OAuth flow of InteractiveBroker.

InteractiveBroker Web API is not ready yet. Don't lose your time.

2

The answer from Daniel is still right (it just doesn't work) there are however a few projects that can alleviate the pain:

Both of them require to run a docker service that will do the authentication and proxy the requests to IB gateway service.

You can avoid 2FA if you create an additional user to access your account.

Ich
  • 1,350
  • 16
  • 27
  • 2
    For others this is in: Profile Icon > Manage Account > User & Access Rights, then after creating new user, type `Pending items` in search bar, then go accept the document – Josh Hibschman Jul 12 '21 at 15:31
  • 1
    Then logout, login again as the new user, go to account management, enter the auth code that went to your email. Then wait 1 business day. This UX is the worst. – Josh Hibschman Jul 12 '21 at 15:48
1

There is no API call to get the consumer_key. There is an OAuth settings page (best I know there is no direct link to it) in the IB web portal that lets you

  • enable OAuth access
  • upload the public Signing/Encryption keys and the DH param files
  • set your own consumer_key

Edit: here is the direct link to the OAuth settings page

kadam
  • 1,259
  • 3
  • 14
  • 27
  • 5
    Is there anybody who found the "OAuth settings page" of IB web portal to load up somehow the things to get "consumer_key"? Thanks IZS – user2005634 Oct 29 '20 at 22:20
  • @user2005634 I have edited the answer with the link to the OAuth settings page – kadam Apr 01 '22 at 01:41
  • If certain elements of the provided link do not work / or simply don’t appear, try the link in incognito mode in your browser, that worked for me – Mike K Apr 22 '23 at 18:15
1

I spent couple of days around solving this problem and after sending ticket to support they told me the 'consumer_key' is an unique arbitrary value provided by client. Thus, I set it and it works. There is some points I want to share with you.

  1. The OAuth document is deprecated. some endpoints are invalid and after ticketing support clear me about them. For example this endpoint Link has been replaced with this.
  2. If you are using self-service portal, you wont need to do two steps (request token and access token generation) and just focus on generating the live session token.
  3. Pay attention to the request format, all the data should be sent as authorization header with following format

{"Authorization": "OAuth realm='limited_poa', oauth_consumer_key='your-consumer-key',..."}

Shepel
  • 11
  • 5
0

You need to go here to register: https://www.interactivebrokers.co.uk/oauth/#/configuration

That link should ask you to authenticate your account.

Once you're there, there is a toggle to enable access. Toggle it on.

Next you generate a 9 character "consumer key". This can just be a random string.

Then follow the steps in this document: https://www.interactivebrokers.com/webtradingapi/oauth.pdf

You'll generate the your public signing key, public encryption key, and diffie-helman parameters.

Upload those files where specified and then you can generate you Access Token and Access Token Secret.

jcity
  • 826
  • 1
  • 9
  • 13
-1

If your talking about the web trading API you have to submit several things to IB in order to get your application registered. Onboarding instructions can be found in their OAuth document at: https://www.interactivebrokers.com/webtradingapi/oauth.pdf

Greg
  • 1
  • The screenshot shared by the OP comes from the document you are referencing, so he read it. a) You do not answer the question, b) The 'onboarding' instructions in the document are super vague. Therefore I downvoted. – douche_satan Jan 07 '21 at 15:37
  • Understood. I could not find onboarding anywhere except to email api@interactivebrokers.com as listed on the site page. Any they have yet to respond after 3 weeks. Also opened a support ticket in my account, same result. Odd being the size they are, everywhere else in the world has an online form to request api access and authorize your application. – Greg Jan 08 '21 at 17:41