title: com.google.firebase.FirebaseException: An internal error has occurred. [ null ]
body: <p>Help guys i want to using firebase to authenticate my apps using custom firebase token, but when the token created and send to my apps firebase cannot authenticate my token and throw </p>
  
  <blockquote>
    <p>com.google.firebase.FirebaseException: An internal error has occurred. [ null ]</p>
  </blockquote>
  
  <p>Webservice code</p>
  
  <pre><code>            FirebaseAuth.getInstance(instancePatient).createCustomToken(uid2, additionalClaims)
                      .addOnSuccessListener(new OnSuccessListener&lt;String&gt;() {
                          @Override
                          public void onSuccess(String customToken) {
                              str.setResponse(customToken);
                              System.out.println(customToken);
                          }
                      });
  </code></pre>
  
  <p>My apps code </p>
  
  <pre><code>    FirebaseAuth mAuth = FirebaseAuth.getInstance();
      mAuth.signInWithCustomToken(userString)
              .addOnCompleteListener(activity, new OnCompleteListener&lt;AuthResult&gt;() {
                  @Override
                  public void onComplete(@NonNull Task&lt;AuthResult&gt; task) {
                      if (!task.isSuccessful()) {
                          try{
                              throw task.getException();
                          }
                          catch (IllegalStateException e){
                              System.out.println(e.getMessage());
                          }
                          catch(RuntimeExecutionException e){
                              System.out.println(e.getMessage());
                          }
                          catch(FirebaseNetworkException e ){
                              System.out.println(e);
                          }
                          catch(FirebaseAuthException e){
                              System.out.println(e);
                          }
                          catch(Exception e){
                              System.out.println(e.getMessage());
                          }
                          listener.onSignInWithCustomTokenFailed(task);
                      }
                      else
                      {......
                      }
                  }
              }
  </code></pre>
  
  <p>i hope you all understand my english.</p>