Particle API JS Multifactor Auth

Trying to use the Particle Javascript API referenced in the official SDK here:
https://docs.particle.io/reference/SDKs/javascript/#logging-in

particle.login({username: 'email@example.com', password: 'pass'}).then(
  function(data){
    console.log('API call completed on promise resolve: ', data.body.access_token);
  },
  function(err) {
    console.log('API call completed on promise fail: ', err);
  }
);

But since particle has migrated to multifactor authentication I’m getting a 403 return from the login methods:

HTTP error 403 from /OAuth/token - Multi-factor authentication required

Is there a better way to login/access my device data using the Javascript API?

you’ll need to provide the one-time password (OTP) via https://github.com/particle-iot/particle-api-js/blob/master/docs/api.md#sendotp

thanks!

1 Like