How to set up blockstack auth on hosted joomla site

Hello all,

I am setting up Blockstack authentication on this website:
OpenBazaar.OnTheBlockchain.com
which is a joomla site hosted on my rochen account. I started this post to get help on some bugs but in the process of writing it up I got it all working so I figured I’d post a few problems I encountered and how I solved them.

I’m following the documentation to install the blockstack JS library here:
https://blockstack.github.io/blockstack.js/
For step 2) import * as blockstack from ‘blockstack’
This was my first time to use the import command so it took me a while to figure out I needed to replace ‘blockstack’ with ‘/my/path/to/node_modules/blockstack/dist/blockstack.js’

This is also my first time to do anything with CORS and it seems that there is some issue with joomla. Here’s what I ended up doing that appears to have worked:
Instead of making a file called manifest.json, I named it manifest.json.php and edited blockstack.js file in two places to reflect this change. At the top of the file I added:

<?php header('Access-Control-Allow-Origin: *'); ?>

The javascript code in the second half of step 5 I wrapped into this:
jQuery( document ).ready(function() {
}
to get it to run.

My next task: signing and storing info in the IPFS (or gaia perhaps).

@davidstrayhorn.id.bl Thank you for posting your steps for hosting on Joomla. This is wonderful. I’ll add that to our deploy doc we are planning.

1 Like

Now that I have auth working for my site, I am trying to figure out how to use the blockstack JS library so that a blockstack user can generate a digital signature for an arbitrary string, and so that another user can verify the signature. I see encryptContent and decryptContent but I do not need the string to be encrypted, just signed. Are there signContent and verifySignature functions somewhere that I am missing? Can anyone point me in the right direction?

Thanks,
David

David you might want to move this into a new question, it will raise the visibility so that others can find it later.