Skip to content

Use default application credential#27

Closed
kroikie wants to merge 3 commits intomasterfrom
use_dac
Closed

Use default application credential#27
kroikie wants to merge 3 commits intomasterfrom
use_dac

Conversation

@kroikie
Copy link
Contributor

@kroikie kroikie commented Jan 25, 2019

Update config quickstart to use default application credential which is best practice for server side Firebase authentication.

* Retrieve a valid access token that can be use to authorize requests to the Remote Config REST
* API.
*
* This method assumes it is either running in a trusted Google environment like GCP or if running

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does "it" refer to the server? Suggest disambiguating.

@samtstern
Copy link
Contributor

@kroikie I'm just gonna review the nodejs one and then you can assume all comments apply in both places and just merge them both when ready.

@kroikie
Copy link
Contributor Author

kroikie commented Jan 30, 2019

@samtstern nodejs is ready so this should be as well.

@kroikie
Copy link
Contributor Author

kroikie commented Jan 30, 2019

Will only merge when documentation that uses these snippets are ready.

private static String getAccessToken() throws IOException {
GoogleCredential googleCredential = GoogleCredential
.fromStream(new FileInputStream("service-account.json"))
GoogleCredential googleCredential = GoogleCredential.getApplicationDefault()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably use com.google.auth.oauth2.GoogleCredentials here.

@hiranya911 hiranya911 assigned kroikie and unassigned hiranya911 Sep 30, 2019
@kroikie kroikie closed this Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants