Created
November 13, 2021 20:29
-
-
Save baso53/1c08c875d0b48169c52913a044e41dec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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