OAuth Callback

Hi

I try to implement a oauth1 usage.

I have one major issue and a minor issue.

Major issue

I need a callback to handle the response after the user logged in successfully. Currently, I set the callback-URL to “obsidian://”. The applicaion is receiving the response as expected.

Here the console log:

Received URL action 
{oauth_token: 'user3.1820CC8F39CD'[..], sandbox_lnb: 'false', reason: 'token_expired', action: ''}

My questions are

  • How to make sure that only my plugin is receiving the response?
  • Is the callback “obsidian://” the best solution?

Minor Issue

I didn’t found a solution to open a HTTP-client, yet. Maybe someone has a tip for me?

Thanks

I solved this issues.

How to handle response after the user logged in successfully?

The user is using an in-app browser windows (class @electron/remote/BrowserWindow) which will be redirected to configured callback by oauth1. A object of BrowserWindow allows to configure a closure to handle a redirect before the request is fired. I used this closure to evaluate the response.

More detail in the code.

How to a HTTP-client?

This is also implicit solved by the solution of the first topic.

1 Like