Skip to content

Instantly share code, notes, and snippets.

@baso53
Created November 13, 2021 20:29
Show Gist options
  • Save baso53/1c08c875d0b48169c52913a044e41dec to your computer and use it in GitHub Desktop.
Save baso53/1c08c875d0b48169c52913a044e41dec to your computer and use it in GitHub Desktop.
@Configuration
public class FirebaseAuthConfig {
@Value("classpath:service-account.json")
Resource serviceAccount;
@Bean
FirebaseAuth firebaseAuth() throws IOException {
var options = FirebaseOptions.builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccount.getInputStream()))
.build();
var firebaseApp = FirebaseApp.initializeApp(options);
return FirebaseAuth.getInstance(firebaseApp);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment