File tree Expand file tree Collapse file tree
config/src/main/java/com/google/firebase/samples/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515import java .io .PrintWriter ;
1616import java .net .HttpURLConnection ;
1717import java .net .URL ;
18+ import java .util .Arrays ;
1819import java .util .Collections ;
1920import java .util .Scanner ;
2021import java .util .zip .GZIPInputStream ;
@@ -28,7 +29,7 @@ public class Configure {
2829 private final static String PROJECT_ID = "<YOUR-PROJECT-ID>" ;
2930 private final static String BASE_URL = "https://firebaseremoteconfig.googleapis.com" ;
3031 private final static String REMOTE_CONFIG_ENDPOINT = "/v1/projects/" + PROJECT_ID + "/remoteConfig" ;
31- private final static String REMOTE_CONFIG_SCOPE = "https://www.googleapis.com/auth/firebase.remoteconfig" ;
32+ private final static String [] SCOPES = { "https://www.googleapis.com/auth/firebase.remoteconfig" } ;
3233
3334 /**
3435 * Retrieve a valid access token that can be use to authorize requests to the Remote Config REST
@@ -40,7 +41,7 @@ public class Configure {
4041 private static String getAccessToken () throws IOException {
4142 GoogleCredential googleCredential = GoogleCredential
4243 .fromStream (new FileInputStream ("service-account.json" ))
43- .createScoped (Collections . singleton ( REMOTE_CONFIG_SCOPE ));
44+ .createScoped (Arrays . asList ( SCOPES ));
4445 googleCredential .refreshToken ();
4546 return googleCredential .getAccessToken ();
4647 }
You can’t perform that action at this time.
0 commit comments