This project gives you the ability to use Firebase User Management and Authentication methods. To achieve this, you just have to add the dependency and simply use the methods in your Spring Boot application. These are the list of methods you can use in this release(1.0.0):
- signUpWithEmailAndPassword
- signInWithEmailAndPassword
- deleteUserAccount
- exchangeRefreshTokenToIdToken
Put a firebase-web-api-key.txt file in the root of classpath and specify firebase-web-api-key : property in it.
firebase-web-api-key : [your-firebase-project-web-api-key]In a @Configuration class in your application, create a @Bean for UserAuthenticationServiceImpl class.
@Configuration
public class DemoConfig {
@Bean
public UserAuthenticationServiceImpl userAuthenticationServiceImpl() {
return new UserAuthenticationServiceImpl();
}
}Primarily, you have to add spring-boot-starter-web dependency in your Spring Boot application.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>Then, you have to also add this dependency in your pom.xml.
<dependency>
<groupId>com.github.alperkurtul</groupId>
<artifactId>spring-boot-starter-firebase-user-authentication</artifactId>
<version>1.0.0.RELEASE</version>
</dependency>Just simply use methods.
@Autowired
private UserAuthenticationServiceImpl userAuthenticationServiceImpl;FirebaseSignInSignUpResponseBean firebaseSignInSignUpResponseBean = userAuthenticationServiceImpl.signInWithEmailAndPassword("[email protected]", "test07");Here is a demo that I made for you. Demo
I hope, I will add new features in the next. Don't be shy to send your advice to me. Take care...