westerlind / alfred-raindrop-search

Search or add Raindrop.io bookmarks from Alfred
MIT License
240 stars 13 forks source link

Unable to login from internet behind proxy #18

Closed HelmiBaraja closed 1 year ago

HelmiBaraja commented 1 year ago

Hi,

first of all, it's a great workflow thanks for invest time to build it. I have used extenstively at home. However, when i work at office, i cannot make it works, since my office has proxy set behind it.

This is what i got after authorize alfred with raindrop. Any helps would be appriciated.

image

westerlind commented 1 year ago

Hi @HelmiBaraja

I'm glad that you like the workflow!

I also think that there is a simple solution to your problem.

There is a setting in Alfred under the Advanced tab that is called "Use macOS http proxy settings for scripts". I'm quite sure that this is not enabled by default, but if you enable it you will make sure that the workflow can pick up your proxy settings and use that for connecting to Raindrop, which should fix the issue.

j0hnpedr0 commented 1 year ago

For anyone still finding the redirects problematic, i.e. the oauth attempt returns a page like below:

"Cannot GET /v1/oauth/authorize%3Fredirect_uri%3Dhttp%253A%252F%252F127.0.0.1%253A11038.%26client_id%3Dabc"

...there seems to be a problem with URL encoding. Some of the parameter elements are double-encoded which may cause a problem during redirect (apologies if I get any of this wrong, i'm not an expert on oauth mechanisms).

My workaround was to use an online url decode service (e.g. https://www.urldecoder.org/) and decode the string as far back as possible to get the fully decoded url. Paste that into your browser after https://api.raindrop.io/ and the oauth redirect should now succeed.

My example above would end up being:

"/v1/oauth/authorize?redirect_uri=http://127.0.0.1:11038.&client_id=abc"

Fully formed URL:

"https://api.raindrop.io/v1/oauth/authorize?redirect_uri=http://127.0.0.1:11038.&client_id=abc"

I hope this helps.

westerlind commented 1 year ago

This problem should be fixed now in version 2.0.9 which is just released a moment ago. https://github.com/westerlind/alfred-raindrop-search/releases