I use a 5/8" fastex like quick release buckle.

I tie the male half of the buckle to the neck of the bear spray cannister using 1/16" inch cord.

I tie the female half of the buckle to the front of my pack's shoulder straps.

The bear spray hangs on the right side of my chest and is readily available if I need it.

When in camp I wear a 1/2" nylon strap around my waist like a belt. It has several female buckle halves attached to it. I snap the bear spray to one of them.

These buckles, by the way, only weigh about 1/5 ounce each. I have them attached to many places on my pack. I attach handkerchiefs, monoculars, hats, etc. to the pack using them. I've never had one break or accidentally open. I buy them at Seattle Fabrics.