title: Adding an Authorization header in getTileUrl for Maps Tile Android
body: <p>I would like to access some Custom Map Tiles when creating a TileOverlay for Google Maps API.</p>
  
  <p>So this is my current code:</p>
  
  <pre><code>TileProvider tileProvider = new UrlTileProvider(256, 256) {
          @Override
          public URL getTileUrl(int x, int y, int z) {
  
              String url = String.format("https://api.mycustommaps.com/v1/%d/%d/%d.jpg", z, x, y);
  
              if (!checkTileExists(x, y, z)) {
                  return null;
              }
  
              try {
                  URL tileUrl = new URL(url);
                  tileUrl.openConnection().addRequestProperty("Authorization", LOGIN_TOKEN);
                  return tileUrl;
              } catch (MalformedURLException e) {
                  e.printStackTrance();
              } catch (IOException e) {
                  e.printStackTrance();
              }
              return null;
          }
      };
  </code></pre>
  
  <p>Since the connection returns 401 Anauthorized, I can't access the tiles. How could I pass Authorization header to let the url know I am authorized to access those tiles?</p>