title: FireBase Rest with auth query param not working
body: <pre><code>   // INIT FIREBASE
      FirebaseOptions options = new FirebaseOptions.Builder()
            .setServiceAccount(new FileInputStream("C:\\path\\testcustom-dff2147d3b14.json"))
            .setDatabaseUrl("https://testcustom-a1a4d.firebaseio.com/")
            .build();
          FirebaseApp.initializeApp(options);
          isFireBaseInit = true;
  
         // GENERATE TOKEN
          String uid = "USER ID SOME RANDOM";
          HashMap&lt;String, Object&gt; additionalClaims = new HashMap&lt;String, Object&gt;();
          String token = FirebaseAuth.getInstance().createCustomToken(uid, additionalClaims);
  </code></pre>
  
  <p>Not from browser if i try to use rest api to fetch data</p>
  
  <p><a href="https://testcustom-a1a4d.firebaseio.com/1719126/1719130/1719121.json?auth=eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJodHRwczovL2lkZW50aXR5dG9vbGtpdC5nb29nbGVhcGlzLmNvbS9nb29nbGUuaWRlbnRpdHkuaWRlbnRpdHl0b29sa2l0LnYxLklkZW50aXR5VG9vbGtpdCIsImNsYWltcyI6eyJ0aW1lQm94SWQiOiIxNzE5MTIxIiwidGVzdFJlc3VsdElkIjoiMTcxOTEzMCIsInRlc3RJZCI6IjE3MTkxMjYiLCJkZWJ1ZyI6dHJ1ZX0sImV4cCI6MTQ3MjAyNjg1MywiaWF0IjoxNDcyMDIzMjUzLCJpc3MiOiJmaXJlYmFzZUB0ZXN0Y3VzdG9tLWExYTRkLmlhbS5nc2VydmljZWFjY291bnQuY29tIiwic3ViIjoiZmlyZWJhc2VAdGVzdGN1c3RvbS1hMWE0ZC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSIsInVpZCI6IjE3MTkxMjYxNzE5MTMwMTcxOTEyMSJ9.ed1_ooA0FEDZ5vn5_JKROfS2ovT9RDjbu22LIYrKgqsMUbOtQ5J73N4--RsILfIUoc10_I4Iv5UBUezTRIVmJ6LusY5oGz9a37ehQcd8-mBdamiySSBdgdw_AB5g4o_1-WoRaTr3FLCKyPLl0xnfwboUTZOK_TIAxwh9ujvelR7ymq4xhA6rp2Ghf6pU30xraCO3UVNeYD9fzox1zcg9HB3_z3ew4MWFt8mpwXSdzZnE3yZAMohvlRUH6--oXsE9a8upCEEK0a7yzqw7HSFE-GGt1O5l5nK-Y0tUC5pVc6gEFIK8sH06RO8zwiYTREywUv9a9JBuRZheLTsaHHIhew" rel="nofollow">https://testcustom-a1a4d.firebaseio.com/1719126/1719130/1719121.json?auth=TOKEN GENERATOR IN JAVA CODE</a></p>
  
  <p>I get following error:</p>
  
  <pre><code>{
    "error" : "Missing claim 'kid' in auth header."
  }
  </code></pre>
  
  <p><strong>What am i doing wrong?</strong></p>
  
  <p>Does custom token doesnot work with rest api.
  DO i need to use <a href="https://firebase.google.com/docs/reference/rest/database/user-auth" rel="nofollow">firebase link</a>, If yes how to add additional claim in it ?</p>
  
  <p>PS:
  firebase sdk version i am using</p>
  
  <p>
      com.google.firebase
      firebase-server-sdk
      3.0.1
  </p>
  
  <p><strong>EDIT: THERE IS A INCONSISTENCY IN FIREBASE DOCUMENTATION</strong></p>
  
  <hr>
  
  <p>FIREBASE <a href="https://firebase.google.com/docs/database/rest/retrieve-data#auth" rel="nofollow">GUIDE</a> DOCUMENTATION SAYS</p>
  
  <blockquote>
    <p>The argument can either be your Firebase app's secret or an
    authentication token, as described in the "Users in Firebase Projects"</p>
  </blockquote>
  
  <p>Type of authentication described are <a href="https://firebase.google.com/docs/auth/users#auth_tokens" rel="nofollow">https://firebase.google.com/docs/auth/users#auth_tokens</a><br>
  <em>Note: custom token is present there</em></p>
  
  <hr>
  
  <p>FIREBASE <a href="https://firebase.google.com/docs/reference/rest/database/#section-param-auth" rel="nofollow">REFERENCE</a> DOCUMENTATION SAYS</p>
  
  <blockquote>
    <p>The argument can either be your Firebase app's secret or an
    authentication token. See the <a href="https://firebase.google.com/docs/reference/rest/database/user-auth" rel="nofollow">REST authentication documentation</a>
    for details.</p>
  </blockquote>
  
  <hr>
  
  <p>So Guide and reference talk differently.</p>
  
  <p><strong>Need help please</strong></p>