Use firebase custom authentication method in Vuejs

Asked

Viewed 62 times

0

I am trying to run firestore authentication through a custom token (JWT). However I am facing problems to do so. The firestore documentation asks us to install the 'npm firebase-admin' library, download json for authentication and then use the code:

firebase.auth().signInWithCustomToken(token).catch(function(error) {
  // Handle Errors here.
  var errorCode = error.code;
  var errorMessage = error.message;
  // ...
});

However I’m not getting the authentication, it gives me the error:

'signInWithCustomToken failed: First argument "token" must be a Valid string.'

Does anyone know what it can be?

  • 1

    Your token is invalid https://firebase.google.com/docs/auth/admin/create-custom-tokens?hl=pt

  • I came to see this page later, thanks @Valdeirpsr

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.