File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
config/src/main/java/com/google/firebase/samples/config Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 15
15
import java .io .PrintWriter ;
16
16
import java .net .HttpURLConnection ;
17
17
import java .net .URL ;
18
+ import java .util .Arrays ;
18
19
import java .util .Collections ;
19
20
import java .util .Scanner ;
20
21
import java .util .zip .GZIPInputStream ;
@@ -28,7 +29,7 @@ public class Configure {
28
29
private final static String PROJECT_ID = "<YOUR-PROJECT-ID>" ;
29
30
private final static String BASE_URL = "https://firebaseremoteconfig.googleapis.com" ;
30
31
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" } ;
32
33
33
34
/**
34
35
* Retrieve a valid access token that can be use to authorize requests to the Remote Config REST
@@ -40,7 +41,7 @@ public class Configure {
40
41
private static String getAccessToken () throws IOException {
41
42
GoogleCredential googleCredential = GoogleCredential
42
43
.fromStream (new FileInputStream ("service-account.json" ))
43
- .createScoped (Collections . singleton ( REMOTE_CONFIG_SCOPE ));
44
+ .createScoped (Arrays . asList ( SCOPES ));
44
45
googleCredential .refreshToken ();
45
46
return googleCredential .getAccessToken ();
46
47
}
You can’t perform that action at this time.
0 commit comments