Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define authentication process for desktop blockstack apps #270

Closed
alidcast opened this issue Oct 17, 2017 · 10 comments
Closed

Define authentication process for desktop blockstack apps #270

alidcast opened this issue Oct 17, 2017 · 10 comments
Labels
feature Brand new functionality. New pages, workflows, endpoints, etc. stale

Comments

@alidcast
Copy link

alidcast commented Oct 17, 2017

Hi, I'm building a desktop app with Electron and was aiming to offer support for Blockstack authentication and storage.

I was porting over the app and encountered problems with authentication specifically since the API requires a manifest uri and a redirect uri.

In regards to the second problem, @larrysalibra addressed it in the slack channel; I haven't had a chance to look into it, but I'll post his response here so it can be useful to others:

For a desktop app, you’d need to register a custom url protocol handler for the redirect. This is similar to how redirects between apps are handled between iOS apps. You’d set the redirect to be to your app to yourapp:// and browser will append the authentication response to it

In regards to the manifest uri, as Larry advised, I'm opening an issue to see how this should best be approached.

// cc @cryptocracy

@alvesjtiago
Copy link

@alidcastano @larrysalibra any news on this? Was hoping to build an electron desktop app for Blockstack's Bounty to Decentralize Communication but it seems that it's still not supported.

It's throwing an "Invalid Sign In Request" error on Blockstack's page and "unsupported browser" & "can not detect custom protocols on this browser" on the electron side.

@jackzampolin
Copy link
Contributor

@alvesjtiago I think @cryptocracy has done some work on this.

@alvesjtiago
Copy link

Thank you @jackzampolin 😊 @cryptocracy were you able to get it working via blockstack.js or directly through the API?

@larrysalibra larrysalibra changed the title blockstack authentication with desktop apps Define authentication process for desktop blockstack apps Jan 12, 2018
@larrysalibra larrysalibra added feature Brand new functionality. New pages, workflows, endpoints, etc. backlog labels Jan 12, 2018
@larrysalibra
Copy link
Contributor

larrysalibra commented Jan 12, 2018

This blocks people trying to make desktop apps is something we should tackle soon. This will also inform the process for native mobile apps.

@larrysalibra larrysalibra changed the title Define authentication process for desktop blockstack apps Define authentication process for native/desktop blockstack apps Jan 12, 2018
@larrysalibra larrysalibra changed the title Define authentication process for native/desktop blockstack apps Define authentication process for desktop blockstack apps Jan 12, 2018
@alvesjtiago
Copy link

@larrysalibra sounds great. After asking here, I've recently been able to integrate blockstack on a demo electron app (https://github.com/alvesjtiago/electron-blockstack-demo). Happy to discuss how to ease the development for native desktop and mobile apps.

@larrysalibra
Copy link
Contributor

@alvesjtiago great to hear! would love to discuss - have time to chat Monday afternoon (i'm in Hong Kong UTC+0800)? drop me an email larry at blockstack.com

@alvesjtiago
Copy link

@larrysalibra sure! I'll send you an email to schedule.

@larrysalibra
Copy link
Contributor

This currently isn't on our roadmap - i've started a forum discussion here to determine if we should change this: https://forum.blockstack.org/t/blockstack-authentication-in-native-desktop-apps/6171?u=larry

In the meantime, the steps following steps should work to enable authentication in a native desktop app:

  1. Prerequisites:
  • Have a web app - app identity is tied to domain control, so you'll need a web app
  • Your native app needs to register a unique custom protocol handler like mycoolapp:
  • web app will need to have a redirect endpoint that that opens the native app using your custom protocol handler and sends the auth response token to it
  1. In the native app generate an authentication request using the makeAuthRequest method of blockstack.js
  2. redirect the user to blockstack:${authRequestToken} if the user has the blockstack native installed, otherwise redirect to http://browser.blockstack.org/auth?authRequest=${authRequestToken}
  3. User approves request and gets directed to the redirect endpoint of your web app that behaves as described earlier
  4. redirect endpoint opens native app
  5. native app using the handlePendingSignIn method

We haven't tried this out but let us know if it works and if this is something you'd like to see first class support for and why in our discussion thread: https://forum.blockstack.org/t/blockstack-authentication-in-native-desktop-apps/6171?u=larry

@stale
Copy link

stale bot commented Jan 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 27, 2021
@stale
Copy link

stale bot commented Feb 3, 2021

This issue has been automatically closed. Please reopen if needed.

@stale stale bot closed this as completed Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Brand new functionality. New pages, workflows, endpoints, etc. stale
Projects
None yet
Development

No branches or pull requests

4 participants