Why would Simperium return an "unknown username" error?

38 Views Asked by At

I am trying to connect to the Simperium API using the Node simperium module. I created a SimpleNote account to use to store the notes, but I am getting an "unknown username" when I try to auth.authorize:

Failed to authenticate Error: unknown username: [email protected]
    at IncomingMessage.<anonymous> 
(/path/to/my/project/node_modules/simperium/lib/simperium/auth.js:71:20)

I am presently logged into the account though, and copy/pasted the email address correctly. What might cause an unknown username error for a valid account?

My code is mostly ripped from the sample:

  var Client = Simperium.Client
  var Auth = Simperium.Auth

  var client = new Client( process.env.SIMPERIUM_APP_ID );

  var auth = new Auth( process.env.SIMPERIUM_APP_ID, process.env.SIMPERIUM_API_KEY );

  var interval = Number.POSITIVE_INFINITY, lastInt;

  client.connect();

  auth.on( 'authorize', function( user ) {
    var notes = client.bucket( 'note' );

    client.accessToken = user.access_token;
  } );

  auth.authorize(
    process.env.SIMPERIUM_EMAIL,
    process.env.SIMPERIUM_PASSWORD
  )
1

There are 1 best solutions below

1
Erik Pukinskis On

It turns out, the Simperium API username needs to be a Simperium account, not a SimpleNote account as the sample code suggests.