I am creating a test ios app to try out/understand the onboarding process using Simple oAuthentication. In the project I have added ParicleDeviceSetupLibrary so that I can use the initial setup UI wizard. I have signed up in Particle Dashboard to create a user credential ‘A’. Under credential A, I created a new product using simple oAuth and added a device (using PariclePhoton#1).
Using the my TestApp I mentioned eariler, I was able to login through the wizard, connect to WIFI and talk to the PariclePhoton #1.
Following step 3, in the document https://docs.particle.io/guide/how-to-build-a-product/authentication/
I am trying to add a new customer to the existing product via this setup Wizard in my App but this fails. With a fresh user/pwd I select the ‘add new user’ function and provide the user/pwd credentials. But this fails
2017-01-20 13:06:11.968686 ParticleConnect[916:266511] ! SparkCloud could not subscribe to devices system events No active access token
2017-01-20 13:07:18.700628 ParticleConnect[916:266511] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-01-20 13:07:18.713130 ParticleConnect[916:266511] [MC] Reading from public effective user settings.
2017-01-20 13:07:37.885912 ParticleConnect[916:266511] Can't find keyplane that supports type 7 for keyboard iPhone-PortraitTruffle-Emoji; using 2689976931_PortraitTruffle_iPhone-Emoji-Keyboard_Letters
2017-01-20 13:07:56.976277 ParticleConnect[916:266511] ! loginWithUser https://api.particle.io/oauth/token Failed (status code 400): {
error = "invalid_grant";
"error_description" = "User credentials are invalid";
}
I have tried adding new user using the Tinker App and it showed the exact same error and behavior.
Been at this for several days now, at my wits end, any help will be very much appreciated.
I dont do iOS, I just do web development… but maybe I can help.
Are you trying to “create a user” via an API call? It looks like error message you are getting indicates you are not supplying the server with the information it is looking for.
I am guessing you are missing the credentials(client ID and secret)
Thank you for the reply.
The (pretending) new user that wants to sign up for a particle account should not have any client ID and secret yet. That’s why one is trying to create it.
My app just us a simple API call SparkSetupMainController( ) (one line of code) to bring up the sign up page wizard as suggested by Particle’s document. The wizard is shown in image above.
Failed to mention that when I run through the setup above (to get the user account created) two or more times, the second time the error is “Could not sign up; user already created”. This leaves me to believe that the first step may have been correct somehow and the first error message complaining about improper credentials is bogus.
I’d really like some help from the particle boys & girls here!