title: Firebase with Spring Boot- integration
body: <p>I would like to protect my REST API with Firebase Authorization. I found some tutorials, but they aren't clear. Also, I didn't find detailed documentation with step by step configuration. This what I have so far:</p>
  
  <pre><code>@Configuration
  public class FirebaseConfig {
  
  @Bean
  public DatabaseReference firebaseDatabse() {
      DatabaseReference firebase = FirebaseDatabase.getInstance().getReference();
      return firebase;
  }
  
  @Value("${rs.pscode.firebase.database.url}")
  private String databaseUrl;
  
  @Value("${rs.pscode.firebase.config.path}")
  private String configPath;
  
  @PostConstruct
  public void init() {
  
      /**
       * https://firebase.google.com/docs/server/setup
       *
       * Create service account , download json
       */
      InputStream inputStream = FirebaseConfig.class.getClassLoader().getResourceAsStream(configPath);
  
      FirebaseOptions options = new FirebaseOptions.Builder().setServiceAccount(inputStream)
              .setDatabaseUrl(databaseUrl).build();
      FirebaseApp.initializeApp(options);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>So I add url to Firebase and secret json generated on Firebase site.</p>
  
  <p>Now, how can I configure it with? For example email and password which will be given by user? </p>
  
  <p>I found this tutorial
  <a href="http://pscode.rs/firebase-and-spring-boot-integration/" rel="nofollow noreferrer">http://pscode.rs/firebase-and-spring-boot-integration/</a>,
  but it seems a bit complex... I am stuck, please help me understand this configuration and integration with spring boot.</p>