Device claiming/unclaiming when is a consumer product


#1

Hoping to get some guidance. My device is a consumer product that may be given/sold to someone else at some point. I am trying to understand the best approach for a new owner to claim the device with our companion mobile app.

I initially created a product Widget and setup the oauth client so that we can create shadow customers for the product. As of right now our mobile app (Titanium app with our own particle softAP lib for claiming) does the following:

  1. Gets claim code from our server for the shadow customer
  2. Prompts user to connect to ssid broadcasting (Photon-xxx etc)
  3. Sets the claim code on the device
  4. Scans for networks to display to user
  5. Configures AP after user has entered username/password for the selected network
  6. Tells the device to reconnect using the configured AP.

This is all working well but I still have a hangup on how this process works for Products as its my understanding if the device is claimed to a Particle Product it must be unclaimed for someone else to claim it. We can’t really have this as they may just give the product to someone or say sell it used on craigslist etc.

My thoughts:

  1. I could just claim every device to our own particle account and on our side keep a reference to which devices our users have. By doing this I wouldn’t need any shadow customers b/c all the devices would technically belong to our account and we would just be shuffling the access on our server side and interacting with the devices using our accounts access token on behalf of that user.

  2. Another option is to not have a Product defined in Particle at all. My understanding is that if the device is not tied to a product it can be claimed by a new owner without any explicit unclaiming process.

I am thinking #1 is a better approach b/c it means I don’t have to have shadow customers at all in Particle. Is there another approach?


#2

Nevermind… I think I had some bad info on product claiming. It looks like this is what happens:

  1. I create Customer 1 in my db and in particle as a shadow customer.
  2. Customer 1 goes through setup of my product and can interact with it.
  3. Customer 2 buys the product from customer 1 and Customer 2 goes through our setup which sends their claim code to the device and provides new wifi creds etc.
  4. When the photon connects to the newly configured wap the device is now showing under Customer 2 in my Particle Product which is what I wanted.

I had some conflicting info on this but read an older post that “physical access means virtual access” so it makes sense that when Customer 2 goes through setup they should be able to claim the device from Customer 1 with no “unclaiming” needed.