Blockstack auth with express


#1

Is there any way to safely implement blockstack authentication into an Express/NodeJS app?

Most of the tutorials are in just React.

Thanks


#2

It depends on what you’re trying to achieve.

If you’re trying to have prove to code on your express server that the user is a certain person, then you could start auth in client side JavaScript and then send the resulting auth request token to your server where you’d run the handlePendingSignIn function.

This makes sense for a traditional client server app looking to add Blockstack auth as a sign in method.

In a full Blockstack app you’d never want to do auth on your server. You’d use Blockstack.js just like in the examples with whatever front end framework you use.


#3

Yeah, for now I basically just want to add Blockstack login to my Express/NodeJS app


#4

I have the same need since I’m currently working on an expressJS-based service and needs to connect to blockstack to get and put files and since it’s will be a server-based service I can’t use blockstack browser to do the authentication.

is there any way that I can fully authenticate a user from a command line and/or nodejs/expressJS? or perhaps I can use an API key from the blockstack browser in my express app that allows me to get and put files.