Two Legged Organisation Authentication Error

Hello this is my current setup:

Organisation setup within Particle
Photon Board

I setup users through my own authentication system (firebase) and when new users are added I make this call : https://api.particle.io/v1/orgs/{org-slug}/customers with the body : {no_password: true, email: customer@email.com} which returns me an access token.

(The customer is not added to the organisation dashboard through, is this expected behaviour? or have I missed something?)

As I’m building in iOS I do the following:

let token //  token provided by https://api.particle.io/v1/orgs/{org-slug}/customers
if SparkCloud.sharedInstance().injectSessionAccessToken(token) {
                print("Injected Session Access Token")
                        if let setupController = SparkSetupMainController() {
                            setupController.delegate = self
                            SparkSetupCustomization.sharedInstance().organization = true
                            SparkSetupCustomization.sharedInstance().organizationName = "My organisation name"
                            SparkSetupCustomization.sharedInstance().organizationSlug = "My organisation slug" // Same as the one used in the above API Call

Problem is when I click “ready” I get the following error, (the iOS device is connected to wifi):

“Error - Could not communicate with Particle cloud, make sure your iOS device is connected to the internet and retry. (Request failed: bad request (400))” I’ve attached a photo.

If I removed the following lines, the error goes away (Is this correct? should I set the organisation details or not?):

SparkSetupCustomization.sharedInstance().organization = true
SparkSetupCustomization.sharedInstance().organizationName = "My organisation name"
SparkSetupCustomization.sharedInstance().organizationSlug = "My organisation slug" // Same as the one used in the above API Call

But another problem arises, after clicking “Ready” and connecting to the Photon board over Wifi I get the following error (this is when a different user tries to claim the same device)

Why is the ownership “null”? Am I missing something in the customer setup?

Sorry for the late reply…
You need to set your orgSlug and productSlug to the correct URL path components.
“My organisation slug” is not a valid slug - login to the dashboard and check your organization and product URL slug components and plug it in the source code, that should fix those errors.

Hello ido,

“My organisation slug” is just a placeholder for the example above, I wasn’t sure if disclosing this would be sensitive information. I used my actual organisation slug to no avail. After lots of googling and this forum being my last port of call I will have to try something else.

@AJ9 did you get this problem solved?
If not I suggest your submit a ticket in our support portal
https://docs.particle.io/support/support-and-fulfillment/menu-base/

@ido, no I didn’t in the end and my organisation trial has now ended. No combination seemed to work ¯\_ (ツ) _/¯

Dashboard/console access is now free for <25 devices per product, so you could give it another shot, for free :slight_smile:

Our new pricing model will let you continue and have access to org and console (previously dashboard) for free.


I suggest you submit a ticket with detailed description of the problem - I want to find a solution that’ll work for you.