node-flickrapi icon indicating copy to clipboard operation
node-flickrapi copied to clipboard

Authorization from an Electron App

Open belazaras opened this issue 8 years ago • 6 comments

Hello, this is not a bug but more of a cry for help. The authorization options include the callback method and the "Paste the oauth_verifier" one but neither is good when having a Electron Desktop App cause there's no callback nor console to type that verifier. I'd like to have an input field where the user can type that in, but how do I give that value to the Flickr object? Thank you very much!

belazaras avatar May 04 '16 15:05 belazaras

In case someone reads this and has the same problem. For some use cases hardcoding the access token after requiring it manually works just fine, because it does not expire unless it gets revoked at flickr.

xenco avatar Feb 01 '17 13:02 xenco

Can electron apps not let you write an input dialog that you then tie back into the auth?

Pomax avatar Feb 01 '17 14:02 Pomax

Electron does not support prompt, because it would block the main thread (https://github.com/electron/electron/issues/472). Is there a way to manually put the verification code in?

xenco avatar Feb 01 '17 19:02 xenco

I didn't say prompt() though. If it's effectively a webapp, can you not just use any of the million "overlay div with an input field and change handing js" dialog solutions?

Pomax avatar Feb 02 '17 00:02 Pomax

I have not tried it yet, because for my use case the solution of hardcoding is fine. For most other it is not, so I will look into building a better solution some time soon. Also I am not sure if I can write a prompt replacement, so your code just works, or if I have to make changes to it. It is a limitation in electron I have come across for the first time.

xenco avatar Feb 02 '17 00:02 xenco

Gotcha

Pomax avatar Feb 02 '17 07:02 Pomax