1
 var auth = {
  username: 'user',
  password: 'password'
};

application.authenticateAccount(auth, function(err, result) {

  result.getAccount(function(err, account) {
    console.log('Account:', account);
  });
};

I am getting an error TypeError : Cannot read property 'getAccount' of undefined

BrTkCa
  • 4,703
  • 3
  • 24
  • 45
Droidr
  • 63
  • 1
  • 2
  • 13
  • It's not working because the error is not `null`, eg: you have an error! The credentials are likely incorrect =) – rdegges Mar 01 '16 at 17:59
  • Credentials are correct! – Droidr Mar 01 '16 at 18:03
  • I don't think so! EG: throw a `console.log(err)` above your `result.getAccount` line, and you'll see what I mean. – rdegges Mar 01 '16 at 18:17
  • You are right. But the credentials are correct. ** userMessage : ' Invalid username or password and developerMessage : Login attempt failed because there is no Account in the Application’s associated Account Stores with the specified username or email ** – Droidr Mar 01 '16 at 22:24
  • That means those credentials supplied are incorrect. Either that -- or the Directory which holds your user Account is NOT mapped to your Application. – rdegges Mar 02 '16 at 00:04
  • I'm using the same href for creating and authenticating account. I don't understand where the directory mismatch occurrs – Droidr Mar 02 '16 at 00:08

1 Answers1

1

In the authenticateAccount callback, is there an error? What does console.log(err) look like?

robertjd
  • 4,723
  • 1
  • 25
  • 29
  • Error: 7104 Login attempt failed because there is no Account in the Application’s associated Account Stores with the specified username or email. There is an account with the specified email and password. I am using the same application for creating account as well as for authentication. But account is being created but not authenticating. – Droidr Mar 01 '16 at 21:50
  • Thanks for the update. Can to tell us what types of account stores that you have mapped to your application, and which of the stores is being used to create new accounts (the default account store)? Thanks! – robertjd Mar 02 '16 at 00:09
  • I have created my own application, and the description says Auto-created directory for the 'Movie Express' application . I don't know if I have answered the question! – Droidr Mar 02 '16 at 00:20
  • That does, thanks! Everything sounds like it's configured correctly. Could you show us the rest of your Express application context? If you get in touch with us via support@stormpath.com we can share code privately on there. Thanks! – robertjd Mar 02 '16 at 00:59