Two Legged Authentication

I I understand it correctly I am trying to use Two Legged Authentication in my android app. I carry user/pw/deviceid/accesstoken in my web database for a user.

Once a user logs into my android app and I verify against my database I think I need to set the accesstoken like:

ParticleCloudSDK.getCloud().setAccessToken(“xxxxxxxxxxxxxxxxxxx”);

is this the way to do authentication? Am I doing the correctly?

Thanks for all your help

Correct, you call setAccessToken before you call startDeviceSetup. By passing in the access token for your newly created two-legged customer two major things happen:

  • The user does not sign in or create an account within the app, it’s done automatically.
  • The device will be claimed to the customer who you’ve created the access token for.

great…that’s what I wanted to do!

1 Like