awiseib / CSharp-CPAPI

MIT License
1 stars 0 forks source link

Getting errors while running OAuth.cs #1

Open Gorg5 opened 4 weeks ago

Gorg5 commented 4 weeks ago

Hi there, I am trying to use OAuth 1.0 to authenticate our calls to IBKR Web API. jcazelib sent us the link to this project as a sample code. I tried to run OAuth.cs file of this project with Consumer Key: TESTCONS and the rest of credentials coming with javascript oauth.web.demo-source project. All test credentials work fine with oauth.web.demo-source project and I can retrieve Live Session Token and call the Web API successfully. But when I try to run OAuth.cs using the same credentials, I get this:

Exception: No PEM encoded data found. (Parameter 'pemData')

After debugging the code I noticed this happens at the following call at line 55 of OAuth.cs file: // Find the pem field content from the StreamReader string PemFields pem_fields = PemEncoding.Find(reader);

Our system is developed in Java and looks like there's no Java sample in IBKR documentation for OAuth 1.0 connection to Web API in Java. I'm basically trying to translate your OAuth.cs to Java, but had no luck as I'm new to OAuth. Could you guys please create a sample in Java as well? I know most major financial institutions use Java for their backend systems and having a workable sample in Java can definitely help IBKR facilitate more integration with those companies. I saw your Java playground project, but looks like it is using TWS Api and has no sample for Web Api either. Can you please point me toward any useful Java sample that I can use for OAuth 1.0 authentication?

Thanks.

awiseib commented 3 weeks ago

Dear participant, please contact us via api@interactivebrokers.com